Mode:

Compact lists

Showing:

Documentation
Parameters
Used by
References
Source
Characters
Main stylesheet AU01_Rosetta_CASEDOC-to-LxAdv_courtcase.xsl
Documentation

Description

  ***This XSLT conversion file is a stand-alone, generated release created from a module based source code.  Any changes to this conversion must be propagated to its original source. ***
This file is not intended to be edited directly, except in a time critical situation such as a  "sev1" webstar.
Please contact Content Architecture for support and for ensuring the source code is updated as needed and a new stand-alone delivery is released.
Compiled:  2018-01-08T15:04:08.351+05:30
Stylesheet version 2.0
Template comment() | text() | processing-instruction()
Documentation

Description

Explanation

This template rule copies over text nodes, comment nodes, and processing instructions to the target as is.


Description

 comments | text | PIs START 
Namespace No namespace
Match comment() | text() | processing-instruction()
Mode #default
Import precedence 0
Source
<xsl:template match="comment() | text() | processing-instruction()">
  <xsl:copy-of select="."/>
</xsl:template>
Template /
Documentation

Description

When matching the / root element, just process child nodes.


Description

 comments | text | PIs END 
Namespace No namespace
Match /
Mode #default
Import precedence 0
Source
<xsl:template match="/">
  <xsl:apply-templates/>
  <!--  for fab pipeline conversions, create an override template on the root node that defines tunnel parameters for $documentLNI and $targetPlatform.  Here is JCD example, note $outputTgroupXmlID may not be necessary for your conversion    -->
  <!--xsl:apply-templates>
			<xsl:with-param name="outputTgroupXmlID" tunnel="yes" as="xs:boolean" select="false()"/>
			<xsl:with-param name="documentLNI" tunnel="yes" as="xs:string" select="if (contains( */@guid:guid , 'urn:contentItem:' )) then
					substring-after( */@guid:guid , 'urn:contentItem:' )
				else if (*/@guid:guid) then
					*/@guid:guid
				else if (contains( */source_doc:metadata/source_mncrdocmeta:chunkinfo/source_mncrdocmeta:lnlni/@lnlni , 'urn:contentItem:' )) then
					substring-after( */source_doc:metadata/source_mncrdocmeta:chunkinfo/source_mncrdocmeta:lnlni/@lnlni , 'urn:contentItem:' )
				else if (*/source_doc:metadata/source_mncrdocmeta:chunkinfo/source_mncrdocmeta:lnlni/@lnlni) then
					*/source_doc:metadata/source_mncrdocmeta:chunkinfo/source_mncrdocmeta:lnlni/@lnlni
				else 'UNKNOWN' "/>
			<xsl:with-param name="targetPlatform" tunnel="yes" as="xs:string" select=" 'fabPipeline' "/>
		</xsl:apply-templates-->
</xsl:template>
Template lncr:*
Documentation

Description

lncr:* are just pass through, just process child elements. lncr:metadata is suppressed.

Namespace No namespace
Match lncr:*
Mode #default
Import precedence 0
Source
<xsl:template match="lncr:*">
  <!--  drop wrapper applied to any lncr:* elements and ignore all children but elements  -->
  <xsl:apply-templates select="*"/>
</xsl:template>
Template lncr:metadata
Namespace No namespace
Match lncr:metadata
Mode #default
Import precedence 0
Source
<xsl:template match="lncr:metadata"/>
Template * | @*
Documentation

Description

* | @* (unmatched element and attribute nodes). This template will throw an error, unless $outputUnmatchedElements is set to 'noErrors' as a parameter to the conversion. Named template "outputErrorMessage" is called which will use the xsl:message instruction to generate an error message. If $outputUnmatchedElements is set to 'ICCE' (the default), then the error message will be in the form of an exception element.

Example exception handling output:

<exception timestamp="2017-01-04 14:54:22">
  <filename>test.xml</filename>
  <status>W</status>
  <code>402</code>
  <context>/jcd:judicialCourtDecision[1]/jcd:information[1]/courtcase:history[1]/courtcase:historySummary[1]/courtcase:historyItem[1]/citation:citation[1]/citation:content[1]/citation:contentSpan[1]/@citation:contentSpanRole</context>
  <message>Unexpected Attribute:  name()=citation:contentSpanRole encountered in source document!  Attribute value is=hierarchyReference</message>
</exception>
			

Description

  suppress lncr:metadata and it's children  
  matched templates  
Namespace No namespace
Match * | @*
Mode #default
References
Parameters
QName Namespace Select Type Tunnel
documentLNI No namespace 'UNKNOWN' xs:string yes
errorStatus No namespace 'W' xs:string yes
targetPlatform No namespace 'ROCKET' xs:string yes
Import precedence 0
Source
<xsl:template match="* | @*">
  <!--  matching this pattern is an error  -->
  <xsl:param name="errorStatus" tunnel="yes" as="xs:string" select=" 'W' "/>
  <!--  default is W for warning.  If 'E' is passed, then some systems will ensure the target document is not passed along in the pipeline  -->
  <xsl:param name="targetPlatform" tunnel="yes" as="xs:string" select=" 'ROCKET' "/>
  <!--  default is ROCKET, which outputs exception element via xsl:message.  fabPipeline outputs to target document  -->
  <xsl:param name="documentLNI" tunnel="yes" as="xs:string" select=" 'UNKNOWN' "/>
  <!--  Used for fabPipeline only, the LNI of the document since filename is not available  -->
  <!--  calling the elementOrAttributeCopy named template to copy the node as is   -->
  <!--    if element node, wrap withinin error element  -->
  <!--    if attribute node, also output an error attribute  -->
  <xsl:choose>
    <xsl:when test=" $outputUnmatchedElements = ( 'ROCKET' , 'ICCE' ) or $targetPlatform = 'fabPipeline' ">
      <xsl:call-template name="outputErrorMessage">
        <xsl:with-param name="messageText" as="xs:string" select="concat( if (self::*) then          'Unexpected Element:  name()='  (:  first item is either element (self::* = true()) or attribute (otherwise)  :)         else           'Unexpected Attribute:  name()=' ,        name() ,             (:  second item is element or attribute name  :)        ' encountered in source document!' ,   (:  third item  :)        if (self::* and text()) then       (:  last item is empty string if element and no text() nodes, or if attribute and no value.  :)          concat( '  Text value is=' , string-join( text() , '' ) ) (: Otherwise provide @ value or text() value  :)         else          if (not(self::*) and . != '') then            concat( '  Attribute value is=' , . )           else '' )"/>
        <xsl:with-param name="errorType" as="xs:string" select=" $targetPlatform "/>
        <!--   ROCKET or fabPipeline error type  -->
        <xsl:with-param name="errorCode" as="xs:string" select=" if (self::*) then '401' else '402' "/>
        <!--   401 if element node, 402 if attribute node  -->
        <xsl:with-param name="context" as="xs:string">
          <xsl:call-template name="generateXPath"/>
        </xsl:with-param>
        <xsl:with-param name="status" as="xs:string" select=" $errorStatus "/>
        <xsl:with-param name="documentLNI" as="xs:string" select=" $documentLNI "/>
        <!--   fabPipeline only  -->
      </xsl:call-template>
    </xsl:when>
    <xsl:when test=" $outputUnmatchedElements = 'noErrors' ">
      <xsl:sequence select="."/>
    </xsl:when>
    <xsl:when test="not($outputErrors)"/>
    <xsl:when test="self::*">
      <!--  self:* is false for attribute nodes  -->
      <error:error>
        <xsl:sequence select="."/>
      </error:error>
      <xsl:call-template name="outputErrorMessage">
        <xsl:with-param name="messageText" as="xs:string" select="concat( 'Unexpected Element:  ' , name() , ' encountered in source document!' )"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <!--  must be an attribute  -->
      <xsl:attribute name="error:error" select="'error:  unexpected attribute!'"/>
      <xsl:sequence select="."/>
      <xsl:call-template name="outputErrorMessage">
        <xsl:with-param name="messageText" as="xs:string" select="concat( 'Unexpected Attribute:  ' , name(..) , '/@' , name() , ' (= ' , . , ') encountered in source document!' )"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Template outputErrorMessage
Documentation

Description

Instructions

Global functions apply primarily to XSL style conversions but would include such items as error messaging, etc.


Description

outputErrorMessage Named Template

This named template is called whenever the XSLT needs to throw an error or warning. It will use the xsl:message instruction to generate an error message. If $errorType is set to 'ROCKET' (the default), then the error message will be in the form of an exception element.

Example exception handling output:

<exception timestamp="2017-01-04 14:54:22">
  <filename>test.xml</filename>
  <status>W</status>
  <code>402</code>
  <context>/jcd:judicialCourtDecision[1]/jcd:information[1]/courtcase:history[1]/courtcase:historySummary[1]/courtcase:historyItem[1]/citation:citation[1]/citation:content[1]/citation:contentSpan[1]/@citation:contentSpanRole</context>
  <message>Unexpected Attribute:  name()=citation:contentSpanRole encountered in source document!  Attribute value is=hierarchyReference</message>
</exception>
				

Description

configurationManagementInformation xmlns="urn:x-lexisnexis:configuration-management:1">
		<title>Globally Shared Functions and Named Templates</title>
		<purpose>This stylesheet module contains XSLT functions and named templates that are globally shared regardless of transformation direction or tier, such as the named template for processing errors, etc.</purpose>
		<versionInfo>
			<version>
				<rev>-00</rev>
				<date>20-Mar-2013</date>
				<author>S. Byland</author>
				<description>Initial version.</description>
			</version>
			<version>
				<rev>A00</rev>
				<date>26-Jan-2016</date>
				<author>S. Byland</author>
				<description>Some general cleanup of comments.  Also commented out elementOrAttributeCopy named template as this method was not really used.  There is some code in the CRM LA-to-MNCR baseline that will need to be modified so as to not use this named template anymore.</description>
			</version>
		</versionInfo>
	</configurationManagementInformation
  global custom functions  
  named template rules START  
  error detected; throw a message to the output START  
Namespace No namespace
Used by
References
Variable
Parameter
Parameters
QName Namespace Select Type Required
CurrentDBD No namespace 'notApplicable' xs:string no
context No namespace '/unknown' xs:string*
documentLNI No namespace 'UNKNOWN' xs:string*
errorCode No namespace '401' xs:string*
errorType No namespace 'ROCKET' xs:string*
messageText No namespace 'Error!' xs:string*
status No namespace 'W' xs:string*
Import precedence 0
Source
<xsl:template name="outputErrorMessage">
  <xsl:param name="CurrentDBD" required="no" as="xs:string" select=" 'notApplicable' "/>
  <xsl:param name="messageText" as="xs:string*" select=" 'Error!' "/>
  <!--  text passed in by caller  -->
  <xsl:param name="errorType" as="xs:string*" select=" 'ROCKET' "/>
  <xsl:param name="errorCode" as="xs:string*" select=" '401' "/>
  <xsl:param name="context" as="xs:string*" select=" '/unknown' "/>
  <xsl:param name="status" as="xs:string*" select=" 'W' "/>
  <xsl:param name="documentLNI" as="xs:string*" select=" 'UNKNOWN' "/>
  <!--   fabPipeline only  -->
  <xsl:choose>
    <xsl:when test=" $errorType = 'debug' ">
      <!-- Example of how debug mode might be used; maybe auto create something like these lines after each template rule when building the monolithic and a certain flag is passed? 
					<xsl:if test=" $debug and contains( . , 'Hello Errors' ) ">
						<xsl:call-template name="outputErrorMessage">
							<xsl:with-param name="messageText" as="xs:string" select=" 'Template:  xh:p[translate( normalize-space( string-join( descendant-or-self::*/text() , ... ]' "/>
							<xsl:with-param name="errorType" as="xs:string" select=" 'debug' "/>
							<xsl:with-param name="context" as="xs:string">
								<xsl:call-template name="generateXPath"/>
							</xsl:with-param>
						</xsl:call-template>
					</xsl:if>
					 end example debug mode  -->
      <xsl:message>
        <xsl:element name="debug" inherit-namespaces="no" namespace="">
          <xsl:attribute name="timestamp" select=" $dateTime "/>
          <xsl:element name="message" inherit-namespaces="no" namespace="">
            <xsl:if test=" $context != '/unknown' ">
              <xsl:text>Context/XPath:  </xsl:text>
              <xsl:sequence select="$context"/>
              <xsl:text>.  </xsl:text>
            </xsl:if>
            <xsl:sequence select="$messageText"/>
          </xsl:element>
        </xsl:element>
      </xsl:message>
    </xsl:when>
    <xsl:when test=" upper-case($errorType) = 'ICCE' or upper-case($errorType)='ROCKET' or $errorType = 'fabPipeline' ">
      <xsl:message>
        <xsl:element name="exception" inherit-namespaces="no" namespace="">
          <xsl:attribute name="timestamp" select=" $dateTime "/>
          <xsl:element name="filename" inherit-namespaces="no" namespace="">
            <xsl:sequence select="$fileName"/>
          </xsl:element>
          <xsl:element name="status" inherit-namespaces="no" namespace="">
            <xsl:sequence select="$status"/>
          </xsl:element>
          <xsl:element name="code" inherit-namespaces="no" namespace="">
            <xsl:sequence select="$errorCode"/>
          </xsl:element>
          <xsl:element name="context" inherit-namespaces="no" namespace="">
            <xsl:sequence select="$context"/>
          </xsl:element>
          <xsl:element name="message" inherit-namespaces="no" namespace="">
            <xsl:sequence select="$messageText"/>
          </xsl:element>
        </xsl:element>
      </xsl:message>
      <xsl:if test=" $errorType = 'fabPipeline' ">
        <xsl:choose>
          <xsl:when test=" $errorCode = '402' ">
            <xsl:attribute name="lnf:exception" namespace="urn:x-lexisnexis:conversion:global:functions:1">
              <xsl:value-of select="$messageText"/>
              <xsl:text>; sourceXPath = </xsl:text>
              <xsl:value-of select="$context"/>
            </xsl:attribute>
          </xsl:when>
          <xsl:otherwise>
            <xsl:element name="exception" inherit-namespaces="no" namespace="urn:x-lexisnexis:conversion:global:functions:1">
              <xsl:attribute name="timestamp" select=" $dateTime "/>
              <xsl:element name="LNI" inherit-namespaces="no" namespace="urn:x-lexisnexis:conversion:global:functions:1">
                <xsl:sequence select="$documentLNI"/>
              </xsl:element>
              <xsl:element name="bundle" inherit-namespaces="no" namespace="urn:x-lexisnexis:conversion:global:functions:1">
                <xsl:sequence select="$bundleID"/>
              </xsl:element>
              <xsl:element name="code" inherit-namespaces="no" namespace="urn:x-lexisnexis:conversion:global:functions:1">
                <xsl:sequence select="$errorCode"/>
              </xsl:element>
              <xsl:element name="sourceXPath" inherit-namespaces="no" namespace="urn:x-lexisnexis:conversion:global:functions:1">
                <xsl:sequence select="$context"/>
              </xsl:element>
              <xsl:element name="message" inherit-namespaces="no" namespace="urn:x-lexisnexis:conversion:global:functions:1">
                <xsl:sequence select="$messageText"/>
              </xsl:element>
            </xsl:element>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </xsl:when>
    <!--for DBD errors, note template matched element name directly in the output file-->
    <xsl:when test="$errorType = 'DBD'">DBDerr:
      <xsl:value-of select="name()"/>
      <!--<xsl:value-of select="error()"/>-->
      <xsl:if test="not($CurrentDBD='DeScopedDbd' or $CurrentDBD = 'notApplicable' )">
        <xsl:message>
          <xsl:text>DBDerr:</xsl:text>
          <xsl:value-of select="$CurrentDBD"/>
          <xsl:text>:</xsl:text>
          <xsl:value-of select="name()"/>
        </xsl:message>
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>
      <xsl:message>
        <xsl:value-of select="$messageText"/>
        <!--  just output the message text to the output  -->
        <xsl:value-of select="$context"/>
      </xsl:message>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Template generateXPath
Documentation

Description

generateXPath Named Template

This named template is used to create the XPath leading to the current node in the form of a string, such as "/jcd:judicialCourtDecision[1]/jcd:information[1]/courtcase:history[1]/courtcase:historySummary[1]/courtcase:historyItem[1]/citation:citation[1]/citation:content[1]/citation:contentSpan[1]/@citation:contentSpanRole". Parameter $includeBrackets can be set to false() to suppress the predicate output if desired.


Description

  error detected; throw a message to the output END  
  generate and output the source XPath START  
  @SBy:  2016-09-20  ROM 1218 IRM Strategic:  updated to allow optionally outputting without brackets (predicates indicating sibling order)  
Namespace No namespace
Used by
Parameters
QName Namespace Select Type
includeBrackets No namespace true() xs:boolean
Import precedence 0
Source
<xsl:template name="generateXPath" as="xs:string">
  <xsl:param name="includeBrackets" as="xs:boolean" select="true()"/>
  <xsl:sequence select=" string-join(  (:  use string join function to insert the '/' chars of the XPath  :)      ( '' ,            (:  Build a sequence of strings.  First item is empty to ensure XPath starts with a '/'  :)       ( for $i in ancestor-or-self::* return   (:  Walk the ancestor-or-self:: axis and return the name of each element followed by position in brackets  :)         concat( name($i) ,   (:  next item is the element name followed by position in brackets  :)            if ($includeBrackets) then concat(             '[' ,     (:  open bracket, then count preceding sibling elements of same name and add 1; convert to string  :)             string( count($i/preceding-sibling::*[name(.) = name($i)]) + 1) ,              ']'  )   (:  close bracket. This for loop returns sequence of strings in form of 'element-name[#]'  :)            else             '' )       ) ,           (:  Last item in sequence is to add the attribute name if necessary, since  :)       if (self::*) then ()     (:  ancestor-or-self::* won't include 'self' if this is an attribute  :)        else concat( '@' , name() )       ) ,      '/' ) "/>
  <!--   Use '/' as the string separator since this is an XPath  -->
</xsl:template>
Template combineTrees
Documentation

Description

combineTrees Named Template

This named template is used to combine the content from following sibling elements of the same base name into a single element, such as lnv:TEXT-1, lnv:TEXT-2, etc., into a single lnv:TEXT-1 element, when these elements contain nested hierarchical content requiring the hierarchies to be knitted back together. It assumes the sibling element descendants are structured the same way, and that the nodes can be combined at specific levels identifed by $combiningElements parameter.

The base element name (such as "lnv:TEXT-") must be passed as parameter $baseEleName, and the sibling nodes passed as $nodesToCombine.

Recursion is used to process through all the siblings provided in $nodesToCombine.


Description

  generate and output the source XPath END  
  combined nested trees START  
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace Type Tunnel
baseEleName No namespace xs:string yes
combiningElements No namespace xs:string*
nodesToCombine No namespace document-node()
Import precedence 0
Source
<xsl:template name="combineTrees" as="element()">
  <!--  combines the content from following sibling elements of the same base name into a single element (into the "-1" element of same name)  -->
  <!--  assumes the sibling element descendants are structured the same way, and that the nodes can be combined at specific levels identifed by $combiningElements parameter  -->
  <xsl:param name="baseEleName" tunnel="yes" as="xs:string"/>
  <!--  base element name before the digit, such as 'lnv:TEXT-'  -->
  <xsl:param name="nodesToCombine" as="document-node()"/>
  <!--  all of the, or the remaing, sibling segments to be combined under one element  -->
  <xsl:param name="combiningElements" as="xs:string*"/>
  <!--  sequence of element names (strings) where node combining can occur  -->
  <xsl:variable name="updatedTree" as="element()">
    <!--  combine first remaining segment with second remaining segment and save in this variable  -->
    <xsl:apply-templates select="$nodesToCombine/*/*[1]" mode="combineTrees">
      <!--  perform combinging of nodes via the combineTrees mode   -->
      <xsl:with-param name="matchingXPath" tunnel="yes" as="xs:string">
        <!--  node combining will occur when current XPath matches this XPath   -->
        <!--  the matching XPath is determined by first finding the last node in the document that contains text.  Then, start moving up the ancestor-or-self axis until arrive at one of the elements identified in $combiningElements   -->
        <xsl:for-each select="$nodesToCombine/*/*[1]/descendant-or-self::*[text()][last()]/ancestor-or-self::*[ name() = $combiningElements ][1]">
          <xsl:call-template name="generateXPath"/>
          <!--  utility that returnes the XPath of the current node   -->
        </xsl:for-each>
      </xsl:with-param>
      <xsl:with-param name="baseEleName" tunnel="yes" as="xs:string" select="$baseEleName"/>
      <!--  pass on baseEleName  -->
      <xsl:with-param name="currentEleName" tunnel="yes" as="xs:string" select=" name( $nodesToCombine/*/*[1] ) "/>
      <!--  pass on the name of the first remaining segment  -->
      <xsl:with-param name="nextEleName" tunnel="yes" as="xs:string" select=" name( $nodesToCombine/*/*[2] ) "/>
      <!--  pass on the name of the next remaining segment  -->
    </xsl:apply-templates>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="$nodesToCombine/*/*[3]">
      <!--  if there are 3 or more siblings, then need to recurse   -->
      <xsl:call-template name="combineTrees">
        <xsl:with-param name="baseEleName" tunnel="yes" as="xs:string" select="$baseEleName"/>
        <!--  pass on baseEleName  -->
        <xsl:with-param name="nodesToCombine" as="document-node()">
          <!--  update nodesToContinue to first be the $updatedTree followed by all other sibling after the 2nd one  -->
          <xsl:document>
            <!--  Forcing nodesToCombine element below to be in the empty namespace.  This is necessary because even though there is no default namespace declared in this XSLT file, 
											there usually is when building the monolithic deliverable stylesheet (and it is set to the base: namespace URI).  In that scenario, when transforming with the monolithic XSLT, 
											this element would be in the base: namespace, and will cause Saxon to throw various errors since the non-namespaced children being combined below are in the empty namespace.  
											Saxon is require to output all the namespace nodes that are in scope for each element, and to have a default namespace of base: copied for an element that is in no namespace is an error.  -->
            <nodesToCombine xmlns="">
              <xsl:copy-of select="$updatedTree"/>
              <!--  first the $updatedTree containing the newly combined siblings  -->
              <xsl:copy-of select="$nodesToCombine/*/*[ position() gt 2 ]"/>
              <!--  remaining siblings to be combined  -->
            </nodesToCombine>
          </xsl:document>
        </xsl:with-param>
        <xsl:with-param name="combiningElements" as="xs:string*" select="$combiningElements"/>
        <!--  pass on combiningElements  -->
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:copy-of select="$updatedTree"/>
      <!--  all siblings combined, just output the newly combined tree   -->
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Template combineSiblingsOfSameName
Documentation

Description

combineSiblingsOfSameName Named Template

This named template is used to combine immediate siblings of the same name into a single target element (instead of multiple target elements of same name).

Within the template of the first sibling, create the output element and apply-templates on child nodes of that element first. Then use for-each to change context to the next sibling and call this named template.

Be sure to suppress elements of the same name that have preceding siblings with that name (elementXYX[ preceding-sibling::node()[1][ self::elementXYX ] ]).


Description

  combined nested trees END  
  combineSiblingsOfSameName START  
Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="combineSiblingsOfSameName" as="item()*">
  <!--  this named template assumes the first sibling's attribute and nodes were already processed, so first call to this rule is the second immediate sibling   -->
  <!--  capture name of current element   -->
  <xsl:variable name="currentEleName" as="xs:string" select="name( . )"/>
  <!--  process child nodes; note attribute nodes are skipped in deference to the first sibling's attributes   -->
  <xsl:apply-templates select="node()"/>
  <!--  recursively process the next immediately following sibling node if it has the same name   -->
  <xsl:for-each select="following-sibling::node()[1][ name() = $currentEleName ]">
    <xsl:call-template name="combineSiblingsOfSameName"/>
  </xsl:for-each>
</xsl:template>
Template node()combineTrees
Documentation

Description

combineTrees Processing Mode

mode="combineTrees" is used in conjunction with the combineTrees named template to combine multiple siblings into a single element (see description for "combineTrees Named Template").

For most nodes in the tree, this mode will simply copy itself to the output destination (equivalent to the identity template).

However, if the current node is a location where a pair of siblng structures can be combined, the combining is done as part of this mode and processing continues.


Description

  combineSiblingsOfSameName END  
  named template rules END  
  modal template rules START  
  combined nested trees mode START  
Namespace No namespace
Match node()
Mode combineTrees
References
Template
Parameters
QName Namespace Type Tunnel
baseEleName No namespace xs:string yes
currentEleName No namespace xs:string yes
matchingXPath No namespace xs:string yes
nextEleName No namespace xs:string yes
Import precedence 0
Source
<xsl:template match="node()" mode="combineTrees">
  <!--  the combineTree mode is used to copy nodes at the same location in a sibling tree as following siblings in current location  -->
  <xsl:param name="matchingXPath" tunnel="yes" as="xs:string"/>
  <!--  the path to the last node containing text in the tree to be combined into  -->
  <xsl:param name="baseEleName" tunnel="yes" as="xs:string"/>
  <!--  base element name before the digit, such as 'lnv:TEXT-'  -->
  <xsl:param name="currentEleName" tunnel="yes" as="xs:string"/>
  <!--  element name of the base of the tree to be combined into  -->
  <xsl:param name="nextEleName" tunnel="yes" as="xs:string"/>
  <!--  element name of the base of the tree to be combined from  -->
  <xsl:variable name="currentXPath" as="xs:string">
    <!--  determine XPath of current node for later use  -->
    <xsl:call-template name="generateXPath"/>
  </xsl:variable>
  <xsl:copy>
    <!--  copy over current node and attributes to the combined tree  -->
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates select="node()" mode="combineTrees"/>
    <!--  process child nodes to be output first, then determine if nodes from other tree need to be copied over as following siblings  -->
    <xsl:if test="$matchingXPath = $currentXPath">
      <!--  if processing the last text-containing node in the primary tree, then need to copy over remaining nodes in following tree as siblings  -->
      <xsl:variable name="currentXPathNoBrackets" as="xs:string">
        <!--  create and save version of current XPath without the square brackets (predicates)  -->
        <xsl:call-template name="generateXPath">
          <xsl:with-param name="includeBrackets" as="xs:boolean" select="false()"/>
        </xsl:call-template>
      </xsl:variable>
      <xsl:for-each select="/*/*[ name() = $nextEleName ]/descendant-or-self::*[text()][1]">
        <!--  now change context over to the first text-containing node in the sibling tree (the one with base element name of $nextEleName)  -->
        <xsl:for-each select="ancestor-or-self::*">
          <!--  start up the ancestor-or-self axis until XPaths match.  Note this should end up at one of the elements identified in $combiningElements  -->
          <xsl:variable name="altTreeXPath" as="xs:string">
            <!--  capture the XPath to compare against current XPath; again no predicates  -->
            <xsl:call-template name="generateXPath">
              <xsl:with-param name="includeBrackets" as="xs:boolean" select="false()"/>
            </xsl:call-template>
          </xsl:variable>
          <!--  since the base element names are different, need to only compare strings after those element names  -->
          <xsl:if test="substring-after( $altTreeXPath , $nextEleName ) = substring-after( $currentXPathNoBrackets , $currentEleName )">
            <xsl:copy-of select="*"/>
            <!--  if the XPaths match, copy over the children.  Note current output destination is the same spot in primary tree   -->
          </xsl:if>
        </xsl:for-each>
      </xsl:for-each>
    </xsl:if>
  </xsl:copy>
  <!--  now need to check if there are nodes in sibling tree that need to get copied *after* current node.  Only check when XPath is the same, or starts with, the matching XPath (leading to last text-containing node in primary tree)  -->
  <xsl:if test="starts-with( $matchingXPath , $currentXPath )">
    <xsl:variable name="currentXPathNoBrackets" as="xs:string">
      <!--  again, create and save version of current XPath without the square brackets (predicates)  -->
      <xsl:call-template name="generateXPath">
        <xsl:with-param name="includeBrackets" as="xs:boolean" select="false()"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:for-each select="/*/*[ name() = $nextEleName ]/descendant-or-self::*[text()][1]">
      <!--  now change context just like before.  The processing below is same, except the copy-of will grab different nodes  -->
      <xsl:for-each select="ancestor-or-self::*">
        <xsl:variable name="altTreeXPath" as="xs:string">
          <xsl:call-template name="generateXPath">
            <xsl:with-param name="includeBrackets" as="xs:boolean" select="false()"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:if test="substring-after( $altTreeXPath , $nextEleName ) = substring-after( $currentXPathNoBrackets , $currentEleName )">
          <!--  if the XPaths match, need to copy over the following siblings of the same node as in the output destination.  Just up to parent and copy child::* as long as not first one.  -->
          <xsl:copy-of select="../*[position() != 1][not( starts-with( name() , $baseEleName ) )]"/>
        </xsl:if>
      </xsl:for-each>
    </xsl:for-each>
  </xsl:if>
</xsl:template>
Template node()fixSourceNesting
Documentation

Description

fixSourceNesting Processing Mode (default rule)

mode="fixSourceNesting" for any node matching this rule will simply copy itself to the output destination (equivalent to the identity template).

It does trap elements in the lndocmeta source namespace and ensures they remain in the source namespace after copying.


Description

  combined nested trees mode END  
  default fixSourceNesting mode START  
Namespace No namespace
Match node()
Mode fixSourceNesting
Import precedence 0
Source
<xsl:template match="node()" mode="fixSourceNesting">
  <!--  the fixSourceNesting mode can be used to resolve issues such as p/lnvxe:text/lnvxe:note when, in the target, note and p are siblings  -->
  <!--  default for this mode is identity template, so first copy over current node and attributes  -->
  <xsl:choose>
    <xsl:when test=" not( self::* ) or ( contains( name() , ':' ) and not( substring-before( name() , ':' ) = 'lndocmeta' ) ) ">
      <xsl:copy>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates select="node()" mode="fixSourceNesting"/>
        <!--  process child nodes  -->
      </xsl:copy>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="nsURI" as="xs:string" select=" if ( substring-before( name() , ':' ) = 'lndocmeta' ) then 'http://www.lexis-nexis.com/lndocmeta' else '' "/>
      <xsl:variable name="eleName" as="xs:string" select=" if ( substring-before( name() , ':' ) = 'lndocmeta' ) then local-name() else name() "/>
      <xsl:element name="{name()}" namespace="{$nsURI}">
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates select="node()" mode="fixSourceNesting"/>
        <!--  process child nodes  -->
      </xsl:element>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Template DATE_attributes
Documentation

Description

  siblingToParentGrouping END  
 This template takes an element having @month, @day, or @year attributes and provides the provided attributes and their enhanced values back to the element. 
 Much of the logic is designed to create a normalized date value of YYYY-MM-DD.   
 @month is tested for value between 1 and 12.  If other value exists, it outputs but does not create a normalized date. Leading zeros added if value is below 9. 
 @day is tested for value between 1 and 31.  If other value exists, it outputs but does not create a normalized date. Leading zeros added if value is below 9. 
 @year is tested for four characters.  By testing for current year value the template outputs a four digit year value when only provided with a two digit year value.  
 Some logic taken from DATE template in '/dataArch/XSLT/ContentArch/CRE-to-LA/modules/lnvxe/n=DATE.xsl' 
Namespace No namespace
Used by
Template
Parameters
QName Namespace
date No namespace
Import precedence 0
Source
<xsl:template name="DATE_attributes">
  <xsl:param name="date"/>
  <xsl:variable name="dayValue" as="xs:integer">
    <xsl:choose>
      <xsl:when test="$date/date/@day">
        <xsl:value-of select="xs:integer($date/date/@day)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>0</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="monthValue" as="xs:integer">
    <xsl:choose>
      <xsl:when test="$date/date/@month">
        <xsl:value-of select="xs:integer($date/date/@month)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>0</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="monthValueString" as="xs:string" select="if ($monthValue lt 10 and $monthValue gt 0) then concat( '0' , string($monthValue) ) else string($monthValue)"/>
  <!-- 20170516:  MCJ:  Added default for $yearValue as was already done for $monthValue and $dayValue. -->
  <!-- <xsl:variable name="yearValue" as="xs:integer" select="xs:integer($date/date/@year)"/> -->
  <xsl:variable name="yearValue" as="xs:integer">
    <xsl:choose>
      <xsl:when test="$date/date/@year">
        <xsl:value-of select="xs:integer($date/date/@year)"/>
      </xsl:when>
      <xsl:otherwise>0</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="current2digitYear" as="xs:integer" select="xs:integer(substring(string(current-date()),3,2))"/>
  <xsl:variable name="outputDay" as="xs:boolean" select="if ($dayValue gt 0 and $dayValue lt 32) then true() else false()"/>
  <xsl:variable name="outputMonth" as="xs:boolean" select="if ($monthValue gt 0 and $monthValue lt 13) then true() else false()"/>
  <xsl:variable name="outputYear" as="xs:boolean" select="if ($yearValue gt 0) then true() else false()"/>
  <xsl:variable name="dayNorm" as="xs:string" select="if ($dayValue lt 10) then concat( '0' , string($dayValue) ) else string($dayValue)"/>
  <xsl:variable name="yearNorm" as="xs:string" select="if ($yearValue lt 10) then concat( '200' , string($yearValue) ) else    if ($yearValue le $current2digitYear) then concat( '20' , string($yearValue) ) else    if ($yearValue lt 100) then concat( '19' , string($yearValue) ) else    if ($yearValue lt 1000) then concat( '0' , string($yearValue) ) else    string($yearValue)"/>
  <xsl:if test="$outputDay and $outputMonth and $outputYear">
    <xsl:attribute name="day" select="$dayValue"/>
  </xsl:if>
  <xsl:if test="$outputMonth and $outputYear">
    <xsl:attribute name="month" select="$monthValueString"/>
  </xsl:if>
  <xsl:if test="$outputYear">
    <xsl:attribute name="year" select="$yearValue"/>
  </xsl:if>
  <!-- NOTE: this is a globally-shared module, no non-global variables should be used. -->
  <!--<xsl:choose>
			<xsl:when test="$streamID='NZ11'"/>
			<xsl:otherwise>-->
  <xsl:if test="$outputDay and $outputMonth and $outputYear and $yearValue lt 10000">
    <xsl:attribute name="normdate" select="concat( $yearNorm , '-' , $monthValueString , '-' , $dayNorm )"/>
  </xsl:if>
  <!--</xsl:otherwise>
		</xsl:choose>-->
</xsl:template>
Template generateNSGlobalBindings
Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="generateNSGlobalBindings">
  <xsl:for-each select="$lexisAdvNamespaces/*">
    <xsl:sort/>
    <xsl:namespace name="{substring-after(substring-before(., '='), ':')}" select="substring-after(translate(., '"', ''), '=')"/>
  </xsl:for-each>
</xsl:template>
Template CASEDOC[@type='fulltext']
Documentation

Description

This Conversion Instruction describes the conversion of Courtcase 9.20 PROD schema in the document.

AU cases are identified using the root element CASEDOC with attribute @type=”fulltext” and docinfo:doc-country iso-cc=”AU”.

CASEDOC becomes courtcase:courtcase. Its a root element for CaseLaw. The source attributes are: @id becomes @xml:id, @xml:lang, if present, suppress attribute and content, as a separate rule has been defined to populate courtcase:courtcase/@xml:lang and @type suppress attribute and content, because the distinction made by this attribute in source is handled by separate schema in NL.

Note: The attribute @searchtype will be suppressed from the conversion except citation markup.


<CASEDOC xml:lang="en-AU" ...>
        ...
        <docinfo:doc-lang lang="en"/>
        <docinfo:doc-country iso-cc="AU"/>
        ...
</CASEDOC>
Becomes

<courtcase:courtcase xml:lang="en-AU">
      
      <courtcase:head>...</courtcase:head>

      <courtcase:body>...</courtcase:body>

      <doc:metadata>...</doc:metadata>
      
</courtcase:courtcase>

courtcase:head, courtcase:body, and doc:metadata are created as required children of courtcase:courtcase

Note:

Source elements and attributes are highlighted like this: SOURCEXML

Target elements and attributes are highlighted like this: TARGETXML

Copy source attributes to target attributes unless otherwise specified.

Every example is represented like "EXAMPLE" in all the dita's and is captured under

pre
tag.

Changes:

2016-06-07: Schema version updated to Courtcase 9.19 PROD


Description

 start topicref  AU01_introduction.dita  
 <topicref href="AU01_introduction.dita"/> 
 Awantika: Completed 
  @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
    Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_introduction.dita  
Namespace No namespace
Match CASEDOC[@type='fulltext']
Mode #default
References
Import precedence 0
Source
<xsl:template match="CASEDOC[@type='fulltext']">
  <!--<xsl:attribute name="xsi:schemaLocation" select="$outputSchemaLoc"/>-->
  <!--  Original Target XPath:  courtcase:courtcase   -->
  <courtcase:courtcase>
    <xsl:call-template name="generateNSGlobalBindings"/>
    <xsl:attribute name="xsi:schemaLocation" select="$outputSchemaLoc"/>
    <xsl:apply-templates select="@*"/>
    <xsl:if test="docinfo/docinfo:doc-lang">
      <xsl:call-template name="xml_lang"/>
    </xsl:if>
    <xsl:apply-templates select="case:body/case:headnote"/>
    <xsl:apply-templates select="toc"/>
    <xsl:apply-templates select="case:body"/>
    <doc:metadata>
      <xsl:if test="//copyright">
        <pubinfo:pubinfo>
          <xsl:apply-templates select="//copyright"/>
        </pubinfo:pubinfo>
      </xsl:if>
      <xsl:apply-templates select="docinfo"/>
    </doc:metadata>
  </courtcase:courtcase>
</xsl:template>
Template case:disposition[parent::case:headnote]
Namespace No namespace
Match case:disposition[parent::case:headnote]
Mode #default
Import precedence 0
Source
<xsl:template match="case:disposition[parent::case:headnote]"/>
Template @type
Namespace No namespace
Match @type
Mode #default
Import precedence 0
Source
<xsl:template match="@type"/>
Template @xml:lang
Namespace No namespace
Match @xml:lang
Mode #default
Import precedence 0
Source
<xsl:template match="@xml:lang"/>
Template docinfo:doc-lang/@lang
Documentation

Description

xml:lang Instructions

The combination of docinfo/docinfo:doc-lang[@lang] and docinfo/docinfo:doc-country[@iso-cc] becomes {target.root.element}[@xml:lang]

Source XML

 <docinfo:doc-lang lang="en"/> <docinfo:doc-country iso-cc="NZ"/> 

Target XML

 <{target.root.elm} xml:lang="en-NZ" ...> 

Source XML

 <docinfo:doc-lang lang="en"/> <docinfo:doc-country iso-cc="GB"/> 

Target XML

 <{target.root.elm} xml:lang="en-GB" ...> 

xml:id Instructions

The attribute xml:id is an W3C standard with a datatype of "ID". Outlined below are some of the cases where the source ID values need to be adjusted to conform to the xml:id standard:

Colon ":" in ID value

When a colon is found within an XML ID replace the colon ":" with an underscore "_" as shown below:

 <level id="NZSTATUTES_ACTS-A4.SGM_PARA-1925A41:1908A96-EDITORIAL-NOTES" leveltype="comm.chap"> 

Target XML

 <primlaw:level id="NZSTATUTES_ACTS-A4.SGM-PARA-1925A41_1908A96-EDITORIAL-NOTES" leveltype="chapter"> 

ID value begins with number

When attribute XML ID value begins with number, then add an underscore "_" as shown below:

 <level id="475:B005_V2:H1" leveltype="chapter" subdoc="false" toc-caption="PART III THE ADMINISTRATION OF ASSETS"> 

Target XML

 <seclaw:level xml:id="_475_B005_V2_H1" leveltype="chapter" includeintoc="false" alternatetoccaption="PART III THE ADMINISTRATION OF ASSETS"> 

Note:

The restrictions and required modifications for xml:id also apply to the following situations:

  • The mapping of refpt/@id to ref:anchor/@id
  • The mapping of footnote/@fntoken to footnote/ref:anchor/@id
  • The mapping fnr/@fnrtoken to footnote-ref/ref:anchor/@id
  • The mapping of fnr/@fntoken to foonote-ref/@anchoridref


Description

 topic: xml.lang attribute 
 <topicref href="../../common_newest/Rosetta_docinfo.doc-lang-and-doc-country-LxAdv-ROOT_xml.lang.dita"/> 
 <topicref href="../../common_newest/Rosetta_docinfo.doc-lang-and-doc-country-LxAdv-ROOT_xml.lang.dita"/> 
    Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.doc-lang-and-doc-country-LxAdv-ROOT_xml.lang.dita  
 WPK: this doc-country template is correct and tested 
<xsl:template name="parse_id">
		<!-\- This template returns valid ID data type value.  -\->
		<xsl:param name="attr_value" select="."/>
		<xsl:if test="contains('0123456789', substring($attr_value, 1, 1))">
			<xsl:text>_</xsl:text>
		</xsl:if>
		<xsl:value-of select="translate($attr_value, ':', '_')"/>
	</xsl:template>
 WPK: this template is correct and tested 
<xsl:template match="@id">
		<!-\- This template creates @xml:id target from @id source.  For any non-specific cases of @id.
                    For specific other use cases of @id, use more specific match, such as "refpt/@id".  -\->
		<xsl:attribute name="xml:id">
			<xsl:call-template name="parse_id">
				<xsl:with-param name="attr_value" select="."/>
			</xsl:call-template>
		</xsl:attribute>
	</xsl:template>
 Vikas Rohilla : Updated the template Removed the double slash	
 2017-10-04 - MDS:  This should not be used.  Instead use the xml_lang named template 
	<xsl:template name="xml_lang_HK">
		<!-\- This template creates @xml:lang from doc-lang and doc-country only for HK stream-\->
		<xsl:attribute name="xml:lang" select="concat(docinfo/docinfo:doc-lang/@lang, '-', docinfo/docinfo:doc-country/@iso-cc)"/>
	</xsl:template>
 WPK: this doc-lang template is correct and tested 
Namespace No namespace
Match docinfo:doc-lang/@lang
Mode #default
Import precedence 0
Source
<xsl:template match="docinfo:doc-lang/@lang">
  <xsl:value-of select="."/>
</xsl:template>
Template docinfo:doc-country/@iso-cc
Documentation

Description

 WPK: this doc-country template is correct and tested 
Namespace No namespace
Match docinfo:doc-country/@iso-cc
Mode #default
Import precedence 0
Source
<xsl:template match="docinfo:doc-country/@iso-cc">
  <xsl:value-of select="."/>
</xsl:template>
Template processing-instruction()
Documentation

Description

Instructions

Throughout these instructions, XML character entities are used in both the source and target examples to ensure they are easily viewable in a variety of formats. However, please keep in mind that all XML character entities in the source files must be converted to Unicode code points in the target files.

Note:

Certain XML character entities will be interpreted by the ‘browser’ or ‘Database’ as code, rather than literal (Unicode exact) character. Therefore, we should not convert certain xml character entities to Unicode character. Refer the below table for your reference:

  • XML Character Entity
  • Character name
  • Transformation Output
  • Remarks
  • &lt;
  • Less-Than Sign
  • &lt;
  • &gt;
  • Greater-Than Sign
  • &gt;
  • &amp;
  • Ampersand
  • &amp;
  • &apos;
  • Apostrophe
  • '  
  • If part of PCDATA this should be converted otherwise left as is in case of attribute value.
  • &quot;
  • Quotation Mark
  • "
  • If part of PCDATA this should be converted otherwise left as is in case of attribute value.

  • Description

    Instructions

    Each source element should be converted to its associated target element such that the target element will occur in the target document in the same relative order as its respective source element did in the source document, so long as the target schema does not require a specific order for that target element within that target element's parent element (first exception), and there are no other instructions regarding the moving of that target element (second exception). In other words, when converting elements from the source documents, the order of elements as they are encountered in the source documents should in general be maintained whenever possible, subject to the two important exceptions mentioned in the previous sentence and elaborated below.

    Note that according to this rule, the order of particular target elements within a parent target element may be different than the order that these elements are listed, noted or otherwise mentioned in these instructions. This includes situations when a set of child target elements are specified in these instructions as items in a list following instructions regarding the parent target element; the order of the items dictates the order that the target elements should occur.

    Elaboration regarding first exception: there are ordering constraints imposed by the target schema for some elements, requiring that target child elements must occur in a certain order within target parent elements, and this order may differ from the order of their corresponding source elements in the source documents. In this case, the constraints imposed by the target schema must be respected.

    Elaboration regarding second exception: there will be occasional scenarios when the source elements must not only be converted to particular target elements, but must also be shifted to specifically different locations within in the target documents. These scenarios will be explicitly mentioned for the source and target elements affected and must override the general rule to maintain element order.

    Processing Instructions

    In the source content there may be processing instructions. For example <?page.*?>. If a processing instruction is encountered it should be suppressed and not converted into the output.


    Description

     Old file: target_xml_char_ent 
     <topicref href="../../common_newest/Rosetta_XML_Character_Entities-LxAdv-Unicode.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_XML_Character_Entities-LxAdv-Unicode.dita  
    xsl:template match="*/text()[ contains( . , '&apos;' ) or contains( . , '&quot;' ) ]">
    		<xsl:variable name="quoteLiterals" as="xs:string">'"</xsl:variable
      Original Target XPath:  Unicodecodepoints   
    xsl:value-of select=" translate( . , '&apos;&quot;' , $quoteLiterals ) "/>
    
    	</xsl:template
     Old file: target_maintain_element_order 
     <topicref href="../../common_newest/Rosetta_Elements-LxAdv-Maintain_Sequential_Order.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_Elements-LxAdv-Maintain_Sequential_Order.dita  
    Namespace No namespace
    Match processing-instruction()
    Mode #default
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="processing-instruction()" priority="25"/>
    Template normalizeIdString
    Documentation

    Description

    Instructions

    Identifiers such as xml:id and ref:anchor/@id are ID data typed. Refer to the target schema/documentation to determine whether or not the value is ID data typed. 

    ID data types cannot contain colons and may not begin with a number (among other restrictions).  To properly map to a node that is ID data typed, conversion instructions state to substitute a colon or a space with an underscore. Also, prefix values beginning with a number, with an underscore. The xml schema will enforce these constraints post conversion.

    Do not convert the following cases:

    • Leading and trailing space(s) (e.g. id=" example_id_value_001 ")
    • XML Entities (e.g. id="example_id_value_001&#xA;")
         

    Example Markup - Source

    
    <refpt id="&#xA;          0KMN_2_F_FC__S_CLAUSE:HTDICT-TERM&#xA;        " type="ext"/>
    
    	

    Example Markup - Target

    
    <ref:anchor id="_0KMN_2_F_FC__S_CLAUSE_HTDICT-TERM" anchortype="global"/>
    
    	

    Other identifiers, such as @anchoridref are not ID data typed. However, they may link to those that are. For example, an @anchoridref may point a ref:anchor/@id. Since @anchoridref is not ID data typed, the ID constraints will not be enforced by the schema post conversion, and will result in broken links. So, to ensure proper link resolution, it is imperative that such identifiers also follow the ID data type restrictions (@anchoridref in this case).


    Description

     end topicref  AU01_introduction.dita  
     start topichead  Mapping to ID Data Type  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_identifier-LxAdv-ID_data_type-HandlingPatternRestrictions.dita  
     
    **************************************************************************************
    NOTE:
    The context node for this template MUST be a string value.
    This template returns a string value that has been modified to 
    meet the restrictions of the xs:id datatype.
    
    It was originally intended for xml:id, id, and ID attributes, but would
    also work for anything else where the xs:id datatype is required.
    
    This template does not handle ALL entities,as 
    Saxon will by default, *resolve* entities before this template 
    processes the string.  XSLT cannot change this behavior. It will now identify and
    replace pointy brackets and ampersands, however, with an underscore as resolving
    those would definitely be a problem for the parser.
    
    ****************************************************************************************
    
    
    Namespace No namespace
    Used by
    Import precedence 0
    Source
    <xsl:template name="normalizeIdString">
      <!-- first step: replace illegal characters with an underscore -->
      <!-- WPK 2017-10-19.  Added mdash to list of disallowed chars. 
    		 WPK 2017-10-24.  	
    				added “  (left double quote #x93;)
    				added €  (non printable control character #x80;)
    				added Â
    				added Ã
    				added ¢
    				added –   (en dash &#x2013;) 
    				
    			Background.  These are likely encoding issues.  This allows for valid IDs to be created because they are invalid characters nevertheless.
    			AU10 PS2017050503412620096LNIAULNPG_input_BUS_GUID_74731000.xml	
    			in		–
    			out		âÂ&#x80;Â&#x93;
    			
    			â    becomes â
    			€    becomes Â&#x80;  (control character displays as blank)
    			“    becomes Â&#x93;  (back slanted double quote)
    			
    			http://www.i18nqa.com/debug/utf8-debug.html
    			(expected is not what LN expects but what the website indicates as expected in its context)
    			Unicode...Windows1252...Expected...Actual...UTF-8 Bytes
    			U+00A2    0xA2          ¢          ¢       %C2 %A2     (not tilde, but carrot - not exactly what is in data)
    			U+201C    0x93          “          “      %E2 %80 %9C   
    			U+00E2    0xE2          â          â       %C3 %A2     (carrot as found in data)
    			
    			AU10 PS2017050812233824638LNIAULNPG_input_BUS_GUID_93431000.xml
    			–   (en dash &#x2013;) 
    	-->
      <xsl:variable name="idWithoutDisallowedChars">
        <xsl:value-of select="translate(. , ',!#$%()*+/:;=?@![]\^`|{}~’‘—“€Ââ–', '__________________________________')"/>
      </xsl:variable>
      <!-- get rid of stubborn entities-->
      <xsl:variable name="idWithoutDisallowedEnts">
        <xsl:analyze-string select="$idWithoutDisallowedChars" regex="<|>|&|'">
          <xsl:matching-substring>
            <xsl:text>_</xsl:text>
          </xsl:matching-substring>
          <xsl:non-matching-substring>
            <xsl:value-of select="."/>
          </xsl:non-matching-substring>
        </xsl:analyze-string>
      </xsl:variable>
      <!-- remove leading and trailing spaces and entities -->
      <xsl:variable name="idWoLeadingSpaces">
        <xsl:value-of select="replace($idWithoutDisallowedEnts, '^\s+', '')"/>
      </xsl:variable>
      <xsl:variable name="idWoTrailingSpaces">
        <!-- this should also handle resolved whitespace and ampersand entities -->
        <xsl:value-of select="replace($idWoLeadingSpaces, '\s+$', '')"/>
      </xsl:variable>
      <xsl:variable name="idWoInternalSpaces">
        <xsl:value-of select="replace($idWoTrailingSpaces, '\s+', '_')"/>
      </xsl:variable>
      <!--  prepend underscore with leading values of period, hyphen, or numeral -->
      <xsl:choose>
        <xsl:when test="matches($idWoInternalSpaces , '^[0-9]|^\.|^\-')">
          <xsl:value-of select="concat('_', $idWoInternalSpaces)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$idWoInternalSpaces"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template normalizeIdString_dropchars
    Documentation

    Description

     named template normalizeIdString_dropchars receives the same input (string) as 
    	normalizeIdString, but replaces all illegal characters and spaces with nothing. It still
    	prepends an underscore if the string begins with a number or illegal starting character. 
    	The output should still be a valid id datatype and NMTOKEN.  This is less commonly used
    	for IDs than the normalizeIdString template but may be useful for some other attributes
    Namespace No namespace
    Import precedence 0
    Source
    <xsl:template name="normalizeIdString_dropchars">
      <!-- first step: replace illegal characters with an underscore -->
      <xsl:variable name="idWithoutDisallowedChars">
        <xsl:value-of select="translate(. , ',!#$%()*+/:;=?@![]\^`|{}~’‘', '')"/>
      </xsl:variable>
      <!-- get rid of stubborn entities-->
      <xsl:variable name="idWithoutDisallowedEnts">
        <xsl:analyze-string select="$idWithoutDisallowedChars" regex="<|>|&|'">
          <xsl:matching-substring/>
          <xsl:non-matching-substring>
            <xsl:value-of select="."/>
          </xsl:non-matching-substring>
        </xsl:analyze-string>
      </xsl:variable>
      <!-- remove leading and trailing spaces and entities -->
      <xsl:variable name="idWoLeadingSpaces">
        <xsl:value-of select="replace($idWithoutDisallowedEnts, '^\s+', '')"/>
      </xsl:variable>
      <xsl:variable name="idWoTrailingSpaces">
        <!-- this should also handle resolved whitespace and ampersand entities -->
        <xsl:value-of select="replace($idWoLeadingSpaces, '\s+$', '')"/>
      </xsl:variable>
      <xsl:variable name="idWoInternalSpaces">
        <xsl:value-of select="replace($idWoTrailingSpaces, '\s+', '')"/>
      </xsl:variable>
      <!--  prepend underscore with leading values of period, hyphen, or numeral -->
      <xsl:choose>
        <xsl:when test="matches($idWoInternalSpaces , '^[0-9]|^\.|^\-')">
          <xsl:value-of select="concat('_', $idWoInternalSpaces)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$idWoInternalSpaces"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template @id | @ID
    Documentation

    Description

    Instructions

    Identifier values in the source, such as @id, may not have uniqueness constraints applied to them. As a result, duplicate identifier values may exist. If such values are mapped to a target such as @xml:id, schema validation errors will occur. The @xml:id attribute is ID data typed, and therefore does have the uniqueness constraint applied. In this case:

    • convert the first value in the duplicate sequence
    • drop the remaining values in the duplicate sequence

    Source XML 1

     <p> <table id="T0103011"> ... </table> </p>
    					<page count="302" /> <p> <table id="T0103011"> ...
    					</table> </p> 

    Target XML 1

     <p> <table xml:id="T0103011"> ... </table> </p>
    					<ref:page num="302"/> <p> <table> ... </table>
    					</p> 

    Description

    stolen from the web, and for reference: id datatypes must follow NCName restrictions		
    		
    Practical restrictions of an NCName
    
    The practical restrictions of NCName are that it cannot contain several symbol characters like :, @,  $, %, &, /, +, ,, ;, 
    whitespace characters or different parenthesis. Furthermore an NCName cannot begin with a number, dot or minus character 
    although they can appear later in an NCName.
    
    Allowed characters: -, ., 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, 
    a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
    
    Also, - and . cannot be used as the first character of the value.
    
    Disallowed characters: , !, ", #, $, %, &, ', (, ), *, +, ,, /, :, ;, <, =, >, ?, @, [, \, ], ^, `, {, |, }, ~ 
     <topicref href="../../common_newest/Rosetta_identifier-LxAdv-ID_data_type-HandlingDuplicates.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_identifier-LxAdv-ID_data_type-HandlingDuplicates.dita  
     1.	 There are @id and @ID elements in dictionarydoc-norm.dtd.  
    		In some cases these need to be transformed to xml:id and in other cases they need to be transformed to @id.  
    		All of them need to be checked for duplicate values. We know these 4 cases:
               The mapping of refpt/@id to ref:anchor/@id - IS DONE IN THIS AND modules/nonamespace/Rosetta_refpt-LxAdv-ref.anchor.xsl
               The following mapping is NOT YET DONE as of 3/20/17 because these modules are not in scope for HK05:
               The mapping of footnote/@fntoken to footnote/ref:anchor/@id
               The mapping fnr/@fnrtoken to footnote-ref/ref:anchor/@id
               The mapping of fnr/@fntoken to foonote-ref/@anchoridref
     
     keys for testing 
    	<xsl:key name="idTypeValue" match="*[@id]" use="@id"/>
    	<xsl:key name="idTypeValue" match="*[@ID]" use="@ID"/>
    	<xsl:key name="idTypeValue" match="footnote" use="@fntoken"/>
    	<xsl:key name="idTypeValue" match="fnr" use="@fnrtoken"/>
    
    	<xsl:include href="Rosetta_identifier-LxAdv-ID_data_type-HandlingPatternRestrictions.xsl"/>
    	
    	<xsl:template match="refpt">
    		<xsl:apply-templates/>	
    		**<xsl:call-template name="amIaDuplicate"/>**
    	</xsl:template>
    	<xsl:template match="footnote">
    		<xsl:apply-templates/>	
    		**<xsl:call-template name="amIaDuplicate"/>**
    	</xsl:template>
    	<xsl:template match="fnr">
    		<xsl:apply-templates/>	
    		**<xsl:call-template name="amIaDuplicate"/>**
    	</xsl:template>
    	<xsl:template match="title">
    		<xsl:apply-templates/>
    		<xsl:if test="@ID or @id">	
    			**<xsl:call-template name="amIaDuplicate"/>**
    		</xsl:if>	
    	</xsl:template>
     end testing code 
    Namespace No namespace
    Match @id | @ID
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="@id | @ID">
      <xsl:if test="not(.='')">
        <xsl:variable name="dupStatus">
          <xsl:for-each select="parent::*">
            <xsl:call-template name="amIaDuplicate"/>
          </xsl:for-each>
        </xsl:variable>
        <xsl:if test="$dupStatus = 'false'">
          <xsl:choose>
            <xsl:when test="local-name(parent::*)='refpt'">
              <xsl:attribute name="id">
                <xsl:call-template name="normalizeIdString"/>
              </xsl:attribute>
            </xsl:when>
            <xsl:otherwise>
              <xsl:attribute name="xml:id">
                <xsl:call-template name="normalizeIdString"/>
              </xsl:attribute>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
      </xsl:if>
    </xsl:template>
    Template amIaDuplicate
    Documentation

    Description

     *****************************************************************************
    			 This named template "amIaDuplicate" returns 'false' if the @id or @ID is 
    			 a unique */@ID or  */@id in the document. It returns 'true' if the @id 
    			 or @ID is the 2nd or subsequent @id or @ID in the document with the same value.
    			 The parent element name does not matter; whether the attribute name is @id 
    			 or @ID does not matter.
    			 
    			 It must be used in conjunction with
    			 
    			 	<xsl:key name="idTypeValue" match="*[@id]" use="@id"/> 
    				<xsl:key name="idTypeValue" match="*[@ID]" use="@ID"/>
    				(if your stream contains footnotes also include)
    				<xsl:key name="idTypeValue" match="footnote" use="@fntoken"/>
    	            <xsl:key name="idTypeValue" match="fnr" use="@fnrtoken"/>
    	            
    			BOTH inserted at the TOP LEVEL of the stylesheet driver.
    			
    			It needs to be called from the element containing the attribute as a context
    			node, not the attribute itself, or it won't work
    			
    			For example:
    				<xsl:template match="refpt">
    					<xsl:call-template name="amIaDuplicate"/>	
    				</xsl:template>
    				
    			will return true if this is a refpt with unique @id or is the first of 
    			more than one element in the document having the same @id or @ID value.
    			How the context template handles this boolean value is left as an exercise
    			for the developer of that template. 
    						
    			If the test for unique values is element-specific or attribute-specific
    			within the document, a copy of/variation on this code with a more specific key is 
    			recommended rather than reusing this generic template.
    			
    			- JL
    		********************************************************************************
    Namespace No namespace
    Used by
    References
    Import precedence 0
    Source
    <xsl:template name="amIaDuplicate">
      <xsl:choose>
        <xsl:when test="not(key('idTypeValue', @id | @ID | @fntoken[parent::footnote] | @fnrtoken[parent::fnr])[2])">
          <!-- id value is unique to document -->
          <xsl:text>false</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:variable name="contextNodeGenID" select="generate-id(.)"/>
          <xsl:choose>
            <xsl:when test="key('idTypeValue', @id | @ID | @fntoken[parent::footnote] | @fnrtoken[parent::fnr])[local-name(.)!=('refpt', 'footnote' , 'fnr')] and key('idTypeValue', @id | @ID)[local-name(.)=('refpt' , 'footnote', 'fnr')]">
              <!--*** key has mixed refpt, footnote, fnr / and other values ***-->
              <!-- non-refpt/footenote/fnr values are all dupes by definition -->
              <!-- TO DO only the first refpt/footnote/fnr key is false -->
              <!-- so IF I am the first refpt/footnote/fnr, I am the only nondupe -->
              <xsl:for-each select="key('idTypeValue', @id | @ID | @fntoken[parent::footnote] | @fnrtoken[parent::fnr])[local-name(.)=('refpt' , 'footnote', 'fnr')][1]">
                <xsl:choose>
                  <xsl:when test="generate-id(.)=$contextNodeGenID">false</xsl:when>
                  <xsl:otherwise>true</xsl:otherwise>
                </xsl:choose>
              </xsl:for-each>
            </xsl:when>
            <xsl:otherwise>
              <!-- everything with matching id is a refpt/footnote/fnr or everything with matching id is not a 
    							refpt/footnote/fnr	so everything but the first id is a dup -->
              <xsl:for-each select="key('idTypeValue', @id | @ID | @fntoken[parent::footnote] | @fnrtoken[parent::fnr])[1]">
                <xsl:choose>
                  <xsl:when test="generate-id(.)=$contextNodeGenID">false</xsl:when>
                  <xsl:otherwise>true</xsl:otherwise>
                </xsl:choose>
              </xsl:for-each>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:headnote
    Documentation

    Description

    <case:headnote>
        ...
        <glp:note>
            <p>
                <text>[<emph typestyle="bf">Note. </emph> As to the distinction between exemplary and aggravated damages, see <emph typestyle="it">Luntz on Assessment of Damages </emph> (2nd ed) para 1.7.01 <emph typestyle="it">et seq </emph> and 12 <emph typestyle="it">Halsbury's Laws of England </emph> (4th ed) para 1189.] </text>
            </p>
        </glp:note>
    </case:headnote>
           
    becomes
    <courtcase:head>
        ...
        <note>
            <bodytext>
                <p>
                    <text>[<emph typestyle="bf">Note. </emph> As to the distinction between exemplary and aggravated damages, see <emph typestyle="it">Luntz on Assessment of Damages </emph> (2nd ed) para 1.7.01 <emph typestyle="it">et seq </emph> and 12 <emph typestyle="it">Halsbury's Laws of England </emph> (4th ed) para 1189.] </text>
                </p>
            </bodytext>
        </note>
    </courtcase:head>
           

    Note: If heading occurs as a direct child of case:headnote, then conversion should create heading as direct child of caseinfo:caseinfo, i.e. case:headnote/heading becomes courtcase:head/caseinfo:caseinfo/heading.

    case:headnote/footnotegrp and case:headnote/page

    If footnotegrp occurs as a direct child of case:headnote then the conversion should append this element as children of nearest element containing bodytext.

    If page occurs as a direct child of case:headnote then the conversion should append this element as children of nearest element.

    The resulting conversion should maintain a physical order with the existing document content.

    Source: case:headnote/footnotegrp and case:headnote/page

                 
    <case:body>
      <case:headnote>
       <case:length>20 Pages</case:length>
       <case:info>...</case:info>
       <catchwordgrp>
        <catchwords>...</catchwords>
       </catchwordgrp>
       <case:factsummary>
       ...
        <p>
         <text>Section 135.4(9) provided that for a person to be guilty of such an offence, <nl/>that
          person must have entered into an agreement with one or more other persons, <nl/>the person and
          at least one other party to the agreement must have intended to do <nl/>the thing pursuant to
          the agreement, and those persons must have committed an <nl/>overt act pursuant to the
          agreement.</text>
        </p>
        <p>
         <text>By s&#x2009;4.1(1) of the Code, a physical element of an offence could be conduct,
          <nl/>and, under s&#x2009;4.1(2), &#x201C;conduct&#x201D; was defined to mean &#x201C;an act,
          an omission to <nl/>perform an act or a state of affairs&#x201D;.</text>
        </p>
       </case:factsummary>
       <footnotegrp>
        <footnote fntoken="2011-80-NSWLR-486.fn_a" fnrtokens="2011-80-NSWLR-486.fnr_a">
         <fnlabel>*</fnlabel>
         <fnbody>
          <p>
           <text>[EDITORIAL NOTE: An application for special leave to appeal to the High Court was
            refused.]</text>
          </p>
         </fnbody>
        </footnote>
       </footnotegrp>
       <page count="487" reporter="NSWLR" text="(2011) 80 NSWLR 486 at " subdoc="true"/>
       <case:decisionsummary>
        <p>
         <text>...             
                 
             

    Target: courtcase:head/casesum:summaries with footnotegroup and ref:page

                 
     <courtcase:head>
       <caseinfo:caseinfo>...</caseinfo:caseinfo>
       <casesum:summaries>
          <casesum:editorialsummary>
             ...
             <p>
               <text>
               Section 135.4(9) provided that for a person to be guilty of such an offence, 
               <proc:nl /> 
               that person must have entered into an agreement with one or more other persons, 
               <proc:nl /> 
               the person and at least one other party to the agreement must have intended to do 
               <proc:nl /> 
               the thing pursuant to the agreement, and those persons must have committed an 
               <proc:nl /> 
               overt act pursuant to the agreement. 
               </text>
             </p>
              <p>
               <text>
               By s?4.1(1) of the Code, a physical element of an offence could be conduct, 
               <proc:nl /> 
               and, under s?4.1(2), “conduct” was defined to mean “an act, an omission to 
               <proc:nl /> 
               perform an act or a state of affairs”. 
               </text>
             </p>
             <p>
               <text>
                 <footnotegroup>
                   <footnote>
                     <ref:anchor id="_2011-80-NSWLR-486.fn_a" /> 
                     <ref:returnreference>
                        <ref:locator anchoridref="_2011-80-NSWLR-486.fnr_a" anchortype="local" /> 
                     </ref:returnreference>
                     <label>*</label> 
                     <bodytext>
                        <p>
                         <text>[EDITORIAL NOTE: An application for special leave to appeal to the High Court was refused.]</text> 
                        </p>
                     </bodytext>
                   </footnote>
                 </footnotegroup>
               </text>
            </p>
           <ref:page includeintoc="true" num="487" page-scheme="500067" page-scheme-type="reporter-series-code" /> 
             </casesum:editorialsummary>
             <casesum:decisionsummary>
               <bodytext>
                 <p>...            
                 
             

    Description

    <xsl:template match="@xml:id">	
    		<xsl:variable name="idval" select="."/>
    		<xsl:if test="not(preceding::*[@xml:id=$idval])">
    			<xsl:attribute name="xml:id">	
    				<xsl:call-template name="normalizeIdString"/>
    			</xsl:attribute>
    		</xsl:if>		
    	</xsl:template>	
     end topichead  Mapping to ID Data Type  
     start topichead  Headnote  
     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.headnote-LxAdv_courtcase.head.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.headnote-LxAdv_courtcase.head.dita  
    Namespace No namespace
    Match case:headnote
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:headnote">
      <!--  Original Target XPath:  ref:page   -->
      <courtcase:head>
        <xsl:apply-templates select="case:info/case:reportercite[@searchtype='BCNUM']" mode="search"/>
        <xsl:for-each-group select="*" group-adjacent="if(self::case:info) then 1 else 0">
          <xsl:if test="current-grouping-key()=1">
            <caseinfo:caseinfo>
              <xsl:apply-templates select="preceding::heading[parent::case:body]"/>
              <xsl:for-each select="current-group()">
                <xsl:apply-templates select="//case:body/case:headnote/heading"/>
                <xsl:apply-templates select="@* | node() except preceding::heading[parent::case:body] except fnr[preceding-sibling::case:casename]"/>
                <!--<xsl:apply-templates select="case:reportercite"/>-->
                <xsl:apply-templates select="case:info/h"/>
                <!--    <xsl:apply-templates select="case:courtinfo/case:judges[ancestor::case:headnote]"/>-->
                <!--<xsl:apply-templates select="case:courtinfo/case:filenum"/> -->
                <!--  <xsl:apply-templates select="case:courtinfo/case:courtcite"/>-->
                <!--webstar 7046666 fix by Pawan Prasad-->
                <!-- <xsl:apply-templates select="case:courtinfo/case:dates"/>-->
              </xsl:for-each>
              <xsl:apply-templates select="following-sibling::catchwordgrp"/>
            </caseinfo:caseinfo>
          </xsl:if>
        </xsl:for-each-group>
        <!--<xsl:apply-templates select="case:body/case:headnote/catchwordgrp"/>-->
        <!-- Awantika: wrapper casesum:summaries for factsummary and decisionsummary -->
        <xsl:if test="case:factsummary | case:decisionsummary | case:references">
          <casesum:summaries>
            <xsl:apply-templates select="case:factsummary" mode="summaries"/>
            <xsl:apply-templates select="case:decisionsummary" mode="summaries"/>
            <xsl:apply-templates select="case:disposition[parent::case:headnote]" mode="summaries"/>
            <!--<xsl:apply-templates select="case:body/case:headnote/case:citations" mode="summaries"></xsl:apply-templates>-->
            <!--<xsl:apply-templates select="case:body/case:content/case:typeofcase" mode="summaries-->
          </casesum:summaries>
          <xsl:apply-templates select="case:references"/>
          <xsl:apply-templates select="case:citations"/>
        </xsl:if>
        <xsl:apply-templates select="footnotegrp"/>
      </courtcase:head>
    </xsl:template>
    Template case:headnote/heading
    Namespace No namespace
    Match case:headnote/heading
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:headnote/heading">
      <heading>
        <xsl:apply-templates/>
      </heading>
    </xsl:template>
    Template case:length
    Documentation

    Description

    <case:length>47 Paragraphs</case:length>
           
    becomes
    <doc:metadata>
        <doc:docinfo>
            ...
            <doc:doclength num="47" unit="Paragraphs" source="conversion"/>
            ...
        </doc:docinfo>
    </doc:metadata>
           

    Note: If case:length occurs within case:embeddedcase, then conversion should suppress case:length and its content.


    Description

     Already Done 
     <topicref href="AU01_Rosetta_case.length-LxAdv_doc.doclength.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.length-LxAdv_doc.doclength.dita  
    Namespace No namespace
    Match case:length
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:length">
      <doc:doclength source="conversion">
        <xsl:attribute name="num">
          <xsl:value-of select="normalize-space(replace(.,'\D+',''))"/>
        </xsl:attribute>
        <xsl:attribute name="unit">
          <xsl:value-of select="normalize-space(replace(.,'\d+',''))"/>
        </xsl:attribute>
      </doc:doclength>
    </xsl:template>
    Template case:length[ancestor::case:embeddedcase]
    Namespace No namespace
    Match case:length[ancestor::case:embeddedcase]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:length[ancestor::case:embeddedcase]"/>
    Template case:info
    Documentation

    Description

    <case:info>
      ...
    </case:info>
          
    becomes
    <caseinfo:caseinfo>
      ...
    </caseinfo:caseinfo>
                

    When heading occurs as direct child of case:body conversion should create heading as direct child of caseinfo:caseinfo, i.e. case:body/heading becomes caseinfo:caseinfo/heading.

    When h occurs as direct child of case:info conversion should create heading as direct child of caseinfo:caseinfo, i.e. case:info/h becomes caseinfo:caseinfo/heading.

    <case:info>
      ...
      <h>Application for registration of trade mark <emph typestyle="smcaps"><emph typestyle="ro">cedarapids</emph></emph></h>
      ...
    </case:info>
          
    becomes
    <caseinfo:caseinfo>
      ...
      <heading>
        <title>Application for registration of trade mark <emph typestyle="smcaps"><emph typestyle="ro">cedarapids</emph></emph></title>
      </heading>
      ...
    </caseinfo:caseinfo>
                

    Description

     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.info-LxAdv_caseinfo.caseinfo.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.info-LxAdv_caseinfo.caseinfo.dita  
    Namespace No namespace
    Match case:info
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:info">
      <!--<caseinfo:caseinfo>
          <xsl:apply-templates select="preceding::heading[parent::case:body]"/> 
          <xsl:apply-templates select="//case:body/case:headnote/heading"/>
          
          <xsl:apply-templates select="@* | node() except preceding::heading[parent::case:body]"/>   
          <!-\-<xsl:apply-templates select="case:reportercite"/>-\->
          <xsl:apply-templates select="case:info/h"/>
          <xsl:apply-templates select="case:courtinfo/case:judges[ancestor::case:headnote]"/>
          <xsl:apply-templates select="case:courtinfo/case:filenum"/>     
          <xsl:apply-templates select="case:courtinfo/case:courtcite"/>
          <xsl:apply-templates select="case:courtinfo/case:dates"/>
          <xsl:apply-templates select="//catchwordgrp"/>           
        </caseinfo:caseinfo>-->
    </xsl:template>
    Template case:info/h
    Documentation

    Description

     Awantika:2017-10-31- added title  
    Namespace No namespace
    Match case:info/h
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:info/h">
      <heading>
        <title>
          <xsl:apply-templates/>
        </title>
      </heading>
    </xsl:template>
    Template case:casename[$streamID='UK01']
    Documentation

    Description

    case:casename becomes caseinfo:casename/caseinfo:fullcasename.

    Any nl elements that occur inside case:casename should be suppressed if they are preceded or followed by a space. Any nl elements that are not preceded or followed by a space should be converted into a single space character.

    Any occurrences of the attribute @ln.user-displayed in case:casename should be suppressed.

    Note: Special note for UK01-UK04, please see ../common_newest/Rosetta_UK_case.casename-Plus-case.reportercite-LxAdv-dc.title.dita for an additional conversion that uses case:info/case:casename.

    Example: CA content

    <case:casename>Entre<nl/> Irving Oil Limited, Demanderesse, et<nl/> Sa Majesté la Reine, Défenderesse</case:casename>
               
    becomes
    <caseinfo:casename>
      <caseinfo:fullcasename>Entre Irving Oil Limited, Demanderesse, et Sa Majesté la Reine, Défenderesse</caseinfo:fullcasename>
    </caseinfo:casename>
               

    Example: AU content

    <case:casename>Re: GOLDEN BREAD PTY. LTD.; THE QUEENSLAND <nl/>CO-OPERATIVE MILLING ASSOCIATION v HUTCHISON</case:casename>
               
    becomes
    <caseinfo:casename>
      <caseinfo:fullcasename>Re: GOLDEN BREAD PTY. LTD.; THE QUEENSLAND CO-OPERATIVE MILLING ASSOCIATION v HUTCHISON</caseinfo:fullcasename>
    </caseinfo:casename>
               

    Example: NZ content

    <case:casename>Smith (Appellant) v Mackenzie (Respondent)</case:casename>
               
    becomes
    <caseinfo:casename>
      <caseinfo:fullcasename>Smith (Appellant) v Mackenzie (Respondent)</caseinfo:fullcasename>
    </caseinfo:casename>
               

    Example: UK content

    <case:casename>Crozier v Wishart &amp; Company Limited and Western Printing Services Ltd</case:casename>
               
    becomes
    <caseinfo:casename>
        <caseinfo:fullcasename>Crozier v Wishart &#x0026; Company Limited and Western Printing Services Ltd</caseinfo:fullcasename>
    </caseinfo:casename>
               

    Description

     Awantika: Completed 
     <topicref href="../../common_caselaw/Rosetta_case.casename-LxAdv_caseinfo.casename_caseinfo.fullcasename.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.casename-LxAdv_caseinfo.casename_caseinfo.fullcasename.dita  
     JD: added $streamID test for VSTS Bug 379082: all casenames should be combined under a single wrapper. 
    Namespace No namespace
    Match case:casename[$streamID='UK01']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:casename[$streamID='UK01']">
      <!--  Original Target XPath:  caseinfo:casename/caseinfo:fullcasename   -->
      <!--		<caseinfo:casename>-->
      <caseinfo:fullcasename>
        <xsl:apply-templates select="@* | node()"/>
        <xsl:apply-templates select="following-sibling::fnr[1]"/>
      </caseinfo:fullcasename>
      <xsl:if test="following-sibling::*[1][self::case:casename]">
        <caseinfo:fullcasename>
          <xsl:apply-templates select="following-sibling::*[1][self::case:casename]/node()"/>
        </caseinfo:fullcasename>
      </xsl:if>
      <xsl:apply-templates select="parent::case:info/child::abbrvname"/>
      <!--</caseinfo:casename>-->
    </xsl:template>
    Template case:casename[$streamID!='UK01'][not(preceding-sibling::*[1][self::case:casename][$streamID=('AU01', 'AU13')])]
    Documentation

    Description

     MDS 2017-07-27 - Added following-sibling::fnr[1] to address input in AU13 
     Awantika:2017-10-31- Added the [not(preceding-sibling::*[1][self::case:casename][$streamID='AU01'])] condition to resolve the ambiguity between two case:casename on line 99 and 116
    Namespace No namespace
    Match case:casename[$streamID!='UK01'][not(preceding-sibling::*[1][self::case:casename][$streamID=('AU01', 'AU13')])]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:casename[$streamID!='UK01'][not(preceding-sibling::*[1][self::case:casename][$streamID=('AU01', 'AU13')])]">
      <!--  Original Target XPath:  caseinfo:casename/caseinfo:fullcasename   -->
      <caseinfo:casename>
        <caseinfo:fullcasename>
          <xsl:apply-templates select="@* | node()"/>
          <xsl:apply-templates select="following-sibling::fnr[1]"/>
        </caseinfo:fullcasename>
        <xsl:if test="following-sibling::*[1][self::case:casename]">
          <caseinfo:fullcasename>
            <xsl:apply-templates select="following-sibling::*[1][self::case:casename]/node()"/>
          </caseinfo:fullcasename>
        </xsl:if>
        <xsl:apply-templates select="parent::case:info/child::abbrvname"/>
      </caseinfo:casename>
    </xsl:template>
    Template case:casename[preceding-sibling::*[1][self::case:casename]]
    Namespace No namespace
    Match case:casename[preceding-sibling::*[1][self::case:casename]]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:casename[preceding-sibling::*[1][self::case:casename]]"/>
    Template case:casename/nl[starts-with(following-sibling::*[1][self::node()],' ') or ends-with(preceding-sibling::*[1][self::node()],' ')][$streamID='CA01']
    Namespace No namespace
    Match case:casename/nl[starts-with(following-sibling::*[1][self::node()],' ') or ends-with(preceding-sibling::*[1][self::node()],' ')][$streamID='CA01']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="case:casename/nl[starts-with(following-sibling::*[1][self::node()],' ') or ends-with(preceding-sibling::*[1][self::node()],' ')][$streamID='CA01']" priority="2"/>
    Template case:casename/nl[$streamID='CA01']
    Namespace No namespace
    Match case:casename/nl[$streamID='CA01']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 1
    Source
    <xsl:template match="case:casename/nl[$streamID='CA01']" priority="1">
      <xsl:text xml:space="preserve"> </xsl:text>
    </xsl:template>
    Template case:casename/nl
    Namespace No namespace
    Match case:casename/nl
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:casename/nl">
      <xsl:text/>
    </xsl:template>
    Template case:casename/@ln.user-displayed
    Namespace No namespace
    Match case:casename/@ln.user-displayed
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:casename/@ln.user-displayed"/>
    Template case:casename/@searchtype
    Namespace No namespace
    Match case:casename/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:casename/@searchtype"/>
    Template case:altname
    Documentation

    Description

    case:altname becomes caseinfo:caseinfo/caseinfo:alternatecasename.

    Note: Conversion should not create consecutive caseinfo:caseinfo elements. When 2 or more consecutive sibling source elements map to caseinfo:caseinfo, data should be merged to a single caseinfo:caseinfo element unless this would hamper content ordering.

    Example: AU content

    <case:info>
        <case:casename>ELECON AUSTRALIA PTY LTD v BREVINI AUSTRALIA PTY LTD (NSD 1423 of
            2004)</case:casename>
        <case:altname>PIV DRIVES GMBH and Another v ELECON AUSTRALIA PTY LTD and Others (NSD 1955 of
            2004)</case:altname>
    </case:info>
               
    becomes
    <caseinfo:caseinfo>
        <caseinfo:casename>
            <caseinfo:fullcasename>ELECON AUSTRALIA PTY LTD v BREVINI AUSTRALIA PTY LTD (NSD 1423 of
                2004)</caseinfo:fullcasename>
        </caseinfo:casename>
        <caseinfo:alternatecasename>PIV DRIVES GMBH and Another v ELECON AUSTRALIA PTY LTD and Others
            (NSD 1955 of 2004)</caseinfo:alternatecasename>
    </caseinfo:caseinfo>
               

    Example: NZ content

    <case:info>
        <case:casename>HITCHENS v DOUBLE ZERO HOLDINGS LTD</case:casename>
        <case:altname>RABSON v DOUBLE ZERO HOLDINGS LTD</case:altname>
    </case:info>
               
    becomes
    <caseinfo:caseinfo>
        <caseinfo:casename>
            <caseinfo:fullcasename>HITCHENS v DOUBLE ZERO HOLDINGS LTD</caseinfo:fullcasename>
        </caseinfo:casename>
        <caseinfo:alternatecasename>RABSON v DOUBLE ZERO HOLDINGS LTD</caseinfo:alternatecasename>
    </caseinfo:caseinfo>
               

    For AU13 Content - case:altname becomes compcase:caseinfo/caseinfo:alternatecasename.

                  <case:info>
                  <case:casename>Re SFE CORPORATION LTD (ABN 74 000 299 392) (No 1)
                  </case:casename>
                  <case:altname>Re SFE CORPORATION LTD (ABN 74 000 299 392) (No 2)</case:altname>
                  ...
                  </case:info>
              
    becomes
                  <compcase:caseinfo>
                  <caseinfo:casename>
                  <caseinfo:fullcasename>Re SFE CORPORATION LTD (ABN 74 000 299 392) (No 1)
                  </caseinfo:fullcasename>
                  </caseinfo:casename>
                  <caseinfo:alternatecasename>Re SFE CORPORATION LTD (ABN 74 000 299 392) (No 2)
                  </caseinfo:alternatecasename>
                  ...
                  </compcase:caseinfo>
              

    Description

     <topicref href="../../common_caselaw/Rosetta_case.altname-LxAdv_caseinfo.alternatecasename.dita"/> 
     Awantika: Completed 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.altname-LxAdv_caseinfo.alternatecasename.dita  
    Namespace No namespace
    Match case:altname
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:altname">
      <!--  Original Target XPath:  caseinfo:caseinfo/caseinfo:alternatecasename   -->
      <caseinfo:alternatecasename>
        <xsl:apply-templates select="@* | node()"/>
      </caseinfo:alternatecasename>
    </xsl:template>
    Template abbrvname
    Documentation

    Description

    case:courtinfo/abbrvname becomes caseinfo:casename/caseinfo:shortcasename.

    <case:courtinfo>
      <abbrvname>SPEDDING v NOBLES;</abbrvname>
    </case:courtinfo>
               
    becomes
    <caseinfo:casename>
      <caseinfo:shortcasename>SPEDDING v NOBLES;</caseinfo:shortcasename>
    </caseinfo:casename>
               

    When emph is a child of abbrvname then conversion should suppressed the emph element from the conversion and retain the text in lowecase.

    <case:courtinfo>
        <abbrvname>R <emph typestyle="smcaps">V</emph> SAFFRON</abbrvname>
    </case:courtinfo>
               
    becomes
    <caseinfo:casename>
        <caseinfo:shortcasename>R v SAFFRON</caseinfo:shortcasename>
    </caseinfo:casename>
               

    Description

     <topicref href="AU01_Rosetta_case.courtinfo_abbrvname-LxAdv_caseinfo.shortcasename.dita"/> 
     Awantika: Completed 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.courtinfo_abbrvname-LxAdv_caseinfo.shortcasename.dita  
    Namespace No namespace
    Match abbrvname
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="abbrvname">
      <!--  Original Target XPath:  caseinfo:casename/caseinfo:shortcasename   -->
      <caseinfo:shortcasename>
        <xsl:apply-templates select="@* | node()"/>
      </caseinfo:shortcasename>
    </xsl:template>
    Template abbrvname/@display-name
    Documentation

    Description

     Awantika: 2017-11-22- 
    Namespace No namespace
    Match abbrvname/@display-name
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="abbrvname/@display-name">
      <xsl:attribute name="name">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template abbrvname/emph
    Namespace No namespace
    Match abbrvname/emph
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="abbrvname/emph"/>
    Template case:reportercite
    Documentation

    Description

    • case:reportercite becomes ref:citations with child elements as described below:
      • Create caseinfo:caseinfo/ref:citations/ref:cite4thisresource with attribute @citetype defines the type of citation "reporter".

        Note: For handling of citation markup; kindly refer to the instructions for ci:cite in the General Markup section.

        Note: Conversion should not create consecutive caseinfo:caseinfo elements. When 2 or more consecutive sibling source elements map to caseinfo:caseinfo, data should be merged to a single caseinfo:caseinfo element unless this would hamper content ordering.

      
      <case:reportercite>
        <ci:cite type="cite4thisdoc">
          <ci:case>
            <ci:caseinfo>
              <ci:decisiondate year="2009"/>
            </ci:caseinfo>
            <ci:caseref>
              <ci:reporter value="ALR"/>
              <ci:volume num="256"/>
              <ci:edition>
                <ci:date year="2009"/>
              </ci:edition>
              <ci:page num="25"/>
              <ci:pinpoint targettype="para" num="4"/>
            </ci:caseref>
          </ci:case>
          <ci:content>
            <citefragment searchtype="CASE-CITE-REF">(2009) 256 ALR 25</citefragment>
          </ci:content>    
        </ci:cite>
      </case:reportercite>
      Becomes
      
      <ref:citations>
        <ref:cite4thisresource citetype="reporter">
          <lnci:cite>
            <lnci:case>
              <lnci:caseinfo>
                <lnci:decisiondate year="2009"/>
              </lnci:caseinfo>
              <lnci:caseref>
                <lnci:reporter value="ALR"/>
                <lnci:volume num="256"/>
                <lnci:edition>
                  <lnci:date year="2009"/>
                </lnci:edition>
                <lnci:page num="25"/>
                <lnci:pinpoint targettype="para" num="4"/>
              </lnci:caseref>
            </lnci:case>
            <lnci:content>(2009) 256 ALR 25</lnci:content>
          </lnci:cite>
        </ref:cite4thisresource>
      </ref:citations>
      

    If case:reportercite/@searchtype has a value of "BCNUM", this indicates that the case is unreported and additional markup should be added to courtcase:head:

    • Create courtcase:statusnotice.
      • Create courtcase:pubstatus with the attribute @status set to "none".
        • Create p/text and populate text with "unreported case" (don't include quotes).

    Additional markup for an unreported case

    
    <case:reportercite searchtype="BCNUM">
        <ci:cite type="cite4thisdoc">
            <ci:case>
                <ci:caseref>
                    <ci:reporter value="urj"/>
                    <ci:refnum num="BC9002970"/>
                </ci:caseref>
            </ci:case>
            <ci:content>
                <citefragment searchtype="CASE-CITE-REF">BC9002970</citefragment>
            </ci:content>
        </ci:cite>
    </case:reportercite>
    
               
    becomes
    
    <courtcase:head>
        <courtcase:statusnotice>
            <courtcase:pubstatus status="none">
                <p>
                    <text>unreported case</text>
                </p>
            </courtcase:pubstatus>
        </courtcase:statusnotice>
        ...
        <ref:citations>
        <ref:cite4thisresource citetype="reporter">
            <lnci:cite>
                <lnci:case>
                    <lnci:caseref>
                        <lnci:reporter value="urj"/>
                        <lnci:refnum num="BC9002970"/>
                    </lnci:caseref>
                </lnci:case>
                <lnci:content>BC9002970</lnci:content>
            </lnci:cite>
        </ref:cite4thisresource>
    </ref:citations>
    </courtcase:head>
    
               

    Description

     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.reportercite-LxAdv_ref.cite4thisresource.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.reportercite-LxAdv_ref.cite4thisresource.dita  
    Namespace No namespace
    Match case:reportercite
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:reportercite">
      <!--  Original Target XPath:  ref:citations   -->
      <ref:citations>
        <ref:cite4thisresource>
          <xsl:attribute name="citetype">
            <xsl:text>reporter</xsl:text>
          </xsl:attribute>
          <xsl:apply-templates select="@* | node()"/>
        </ref:cite4thisresource>
      </ref:citations>
    </xsl:template>
    Template case:reportercite[@searchtype='BCNUM']search
    Namespace No namespace
    Match case:reportercite[@searchtype='BCNUM']
    Mode search
    Import precedence 0
    Source
    <xsl:template match="case:reportercite[@searchtype='BCNUM']" mode="search">
      <courtcase:statusnotice>
        <courtcase:pubstatus status="none">
          <p>
            <text>unreported case</text>
          </p>
        </courtcase:pubstatus>
      </courtcase:statusnotice>
    </xsl:template>
    Template case:reportercite/@searchtype
    Documentation

    Description

    <xsl:template match="case:reportercite[@searchtype!='BCNUM']">
    		<ref:citations>
    			<ref:cite4thisresource citetype="reporter">
    				<xsl:apply-templates select="@* | node()"/>
    			</ref:cite4thisresource>
    		</ref:citations>
    	</xsl:template>
    	
    	<xsl:template match="case:reportercite/@searchtype"/>
    
    	<xsl:template match="case:reportercite[@searchtype='BCNUM']">
    		<courtcase:statusnotice>
    			<courtcase:pubstatus status="none">
    				<p>
    					<text>unreported case</text>
    				</p>
    			</courtcase:pubstatus>
    		</courtcase:statusnotice>
    	  <!-\-<xsl:apply-templates select="case:reportercite"/>-\->
    		<!-\-<ref:citations>
    			<ref:cite4thisresource citetype="reporter">				
    				<xsl:apply-templates select="@* | node()"/>
    			</ref:cite4thisresource>
    		</ref:citations>-\->
    	</xsl:template>
    Namespace No namespace
    Match case:reportercite/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:reportercite/@searchtype"/>
    Template case:parallelcite
    Documentation

    Description

    Note: Text occurring between case:parallelcite and ci:cite should be dropped since it will be handled on a presentation spec level.

    For case:parallelcite[ci:cite@type="reporter"]then it becomes ref:parallelcite[@citetype="reporter"].

    <case:info>
      <case:parallelcite>Also reported at: <ci:cite searchtype="CASE-REF">
          <ci:case>
            <ci:caseref ID="cr000001" spanref="cr000001-001">
              <ci:reporter value="Qd R"/>
              <ci:volume num="2"/>
              <ci:edition>
                <ci:date year="1995"/>
              </ci:edition>
              <ci:page num="506"/>
            </ci:caseref>
          </ci:case>
          <ci:content>
            <citefragment searchtype="CASE-CITE-REF">
              <ci:span spanid="cr000001-001">[1995] 2 Qd R 506</ci:span>
            </citefragment>
          </ci:content>
        </ci:cite>
      </case:parallelcite>
    </case:info>
               
    becomes
    <caseinfo:caseinfo>
      <ref:citations>
        <ref:cite4thisresource citetype="parallel">
          <lnci:cite>
            <lnci:case>
              <lnci:caseref ID="cr000001">
                <lnci:reporter value="Qd R"/>
                <lnci:volume num="2"/>
                <lnci:edition>
                  <lnci:date year="1995"/>
                </lnci:edition>
                <lnci:page num="506"/>
              </lnci:caseref>
            </lnci:case>
            <lnci:content>[1995] 2 Qd R 506</lnci:content>
          </lnci:cite>
        </ref:cite4thisresource>
      </ref:citations>
    </caseinfo:caseinfo>
               

    Changes Specific to AU01

    2016-06-07: Added new instruction case:parallelcite[ci:cite@type="reporter"]to ref:parallelcite[@citetype="reporter"] Applicable on AU01, Webstar # 6497089.


    Description

     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.parallelcite-LxAdv_ref.cite4thisresource.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.parallelcite-LxAdv_ref.cite4thisresource.dita  
    Namespace No namespace
    Match case:parallelcite
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:parallelcite">
      <!--  Original Target XPath:  ref:parallelcite[@citetype="reporter"]
    		-->
      <ref:citations>
        <ref:cite4thisresource citetype="parallel">
          <xsl:apply-templates select="@* | node()"/>
        </ref:cite4thisresource>
      </ref:citations>
    </xsl:template>
    Template case:parallelcite/@ln.user-displayed
    Namespace No namespace
    Match case:parallelcite/@ln.user-displayed
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:parallelcite/@ln.user-displayed"/>
    Template text()[parent::case:parallelcite and following-sibling::ci:cite]
    Namespace No namespace
    Match text()[parent::case:parallelcite and following-sibling::ci:cite]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="text()[parent::case:parallelcite and following-sibling::ci:cite]"/>
    Template case:parallelcite[ci:cite[@type='reporter']]
    Namespace No namespace
    Match case:parallelcite[ci:cite[@type='reporter']]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:parallelcite[ci:cite[@type='reporter']]">
      <ref:citations>
        <ref:parallelcite>
          <xsl:apply-templates select="@* | node()"/>
        </ref:parallelcite>
      </ref:citations>
    </xsl:template>
    Template case:courtinfo
    Documentation

    Description

    case:courtinfo becomes /caseinfo:caseinfo/jurisinfo:courtinfo.

    Note: Conversion should not create consecutive caseinfo:caseinfo elements. When 2 or more consecutive sibling source elements map to caseinfo:caseinfo, data should be merged to a single caseinfo:caseinfo element unless this would hamper content ordering.


    Description

     Already Done 
     <topicref href="../../common_caselaw/Rosetta_case.courtinfo-LxAdv_caseinfo.caseinfo_caseinfo.jurisinfo.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.courtinfo-LxAdv_caseinfo.caseinfo_caseinfo.jurisinfo.dita  
    Namespace No namespace
    Match case:courtinfo
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:courtinfo">
      <!--  Original Target XPath:  /caseinfo:caseinfo/jurisinfo:courtinfo   -->
      <xsl:choose>
        <xsl:when test="parent::case:judgment">
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:otherwise>
          <jurisinfo:courtinfo>
            <xsl:apply-templates select="case:courtcode"/>
            <xsl:apply-templates select="case:courtname"/>
            <xsl:apply-templates select="case:juris"/>
          </jurisinfo:courtinfo>
          <!-- Awantika: 2017-10-17: Added case:dates and case:judges in except condition for HK03 -->
          <!-- Awantika: 2017-10-27- removing page if coming under case:courtinfo and placing it inside courtcase:panel -->
          <!--SS[2017-11-21]: Added this condition "./text()[preceding-sibling::case:courtcode and following-sibling::case:judges][$streamID='AU01']" for moving text() of case:courtinfo under target 'courtcase:judges' element -->
          <!--SS[2017-01-12]: Added this condition "./text()[preceding-sibling::case:courtcode and following-sibling::case:courtloc][$streamID='NZ03']" for moving text() of case:courtinfo under target 'location:city' element -->
          <!--RS[2018-01-04]: Modify the condition "./text()[preceding-sibling::case:courtcode or preceding-sibling::case:courtname and following-sibling::case:judges][$streamID='AU01']" for moving text() of case:courtinfo under target 'courtcase:judges' element -->
          <xsl:apply-templates select="@* | node() except (case:courtcode | case:courtname | case:juris | ./text()[following-sibling::case:courtloc][$streamID=('AU09','AU01')] | ./text()[preceding-sibling::case:courtcode or preceding-sibling::case:courtname and following-sibling::case:judges][$streamID='AU01'] | ./text()[preceding-sibling::case:courtcode and following-sibling::case:courtloc][$streamID='NZ03'] | case:courtloc[$streamID=('AU09','AU01', 'NZ03')] | case:judges[$streamID=('HK03')] | case:dates[$streamID=('HK03')] | page[$streamID='HK03'] | ./text()[preceding-sibling::case:filenum and following-sibling::filenum][$streamID='NZ03'] | ./text()[preceding-sibling::case:dates and following-sibling::case:dates][$streamID='NZ03'])"/>
          <!--<xsl:apply-templates select="case:filenum"/>
                      <xsl:apply-templates select="case:judges[ancestor::case:headnote]"/>
                      <xsl:apply-templates select="case:dates"/>-->
          <!--<xsl:apply-templates select="case:judges[ancestor::case:headnote]"/>
                                    <xsl:apply-templates select="case:dates"/>-->
          <!--<xsl:apply-templates select="@* | node()"/>-->
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:courtname
    Documentation

    Description

    case:courtname becomes jurisinfo:courtname.

    Note: Any nl elements that occur inside case:courtname should be suppressed if they are preceded or followed by a space. Any nl elements that are not preceded or followed by a space should be converted into a single space character.

    Note: Exception scenario for CA01-Cases: nl becomes proc:nl that occur inside case:courtname.

    Example: CA Content

    <case:courtinfo>
        ...
        <abbrvname ln.user-displayed="false">NTSC</abbrvname>
        <case:courtname>Supreme Court of The Northwest Territories<nl/> Yellowknife, Northwest Territories</case:courtname>
        ...
    </case:courtinfo>
               
    becomes
    <jurisinfo:courtinfo>
        ...
        <jurisinfo:courtname normscheme="calongabbr">Supreme Court of The Northwest Territories<proc:nl/>
        Yellowknife, Northwest Territories</jurisinfo:courtname>
        ...
    </jurisinfo:courtinfo>
               

    Example: NZ Content

    <case:courtinfo>
      <case:courtname>Court of Appeal</case:courtname>
    </case:courtinfo>
          
    becomes
    <jurisinfo:courtinfo>
        <jurisinfo:courtname>Court of Appeal</jurisinfo:courtname>
    </jurisinfo:courtinfo>
          
    signing

    Example: UK Content

    <case:courtinfo>
      <case:courtname>TRIBUNAL CENTRE: LONDON</case:courtname>
    </case:courtinfo>
          
    becomes
    <jurisinfo:courtinfo>
        <jurisinfo:courtname>TRIBUNAL CENTRE: LONDON</jurisinfo:courtname>
    </jurisinfo:courtinfo>
          

    Description

    	<xsl:template match="case:courtinfo">
    		<!-\-  Original Target XPath:  /caseinfo:caseinfo/jurisinfo:courtinfo   -\->
    		<jurisinfo:courtinfo>
    			<xsl:apply-templates select="case:courtcode"/>
    			<xsl:apply-templates select="case:courtname"/>
    			<xsl:apply-templates select="case:juris"/>
    		</jurisinfo:courtinfo>
    		<xsl:apply-templates select="@* | node() except (case:courtcode | case:courtname | case:juris | ./text()[following-sibling::case:courtloc][$streamID='AU09'] | case:courtloc[$streamID='AU09'])"/>
    		<!-\-<xsl:apply-templates select="case:filenum"/>
    	  <xsl:apply-templates select="case:judges[ancestor::case:headnote]"/>
    	  <xsl:apply-templates select="case:dates"/>-\->
    		<!-\-<xsl:apply-templates select="case:judges[ancestor::case:headnote]"/>
    		<xsl:apply-templates select="case:dates"/>-\->
    		<!-\-<xsl:apply-templates select="@* | node()"/>-\->
     Awantika: Completed 
     <topicref href="../../common_caselaw/Rosetta_case.courtname-LxAdv_jurisinfo.courtname.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.courtname-LxAdv_jurisinfo.courtname.dita  
     Vikas Rohilla : Template to match the case:courtname and create the jurisinfo:courtname 
    Namespace No namespace
    Match case:courtname
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:courtname">
      <jurisinfo:courtname>
        <!-- JD: 2017-06-15: In UK01 this is shown in example code in CI but not mentioned elsewhere and not present in DT output.
    			Adding exclusion test for UK01, but I suspect rather than include this will need to be specifically included for certain streams.
    			-->
        <xsl:if test="not($streamID='UK01' or $streamID='MY01')">
          <xsl:attribute name="normscheme">
            <xsl:text>calongabbr</xsl:text>
          </xsl:attribute>
        </xsl:if>
        <xsl:apply-templates select="preceding-sibling::abbrvname"/>
        <xsl:apply-templates select="@* | node()"/>
      </jurisinfo:courtname>
    </xsl:template>
    Template case:courtname[$streamID=('AU01', 'NZ03', 'AU09')]
    Namespace No namespace
    Match case:courtname[$streamID=('AU01', 'NZ03', 'AU09')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:courtname[$streamID=('AU01', 'NZ03', 'AU09')]">
      <!--Satbir: Added condition for dropping EMPTY element-->
      <xsl:choose>
        <xsl:when test="not(*) and not(normalize-space())"/>
        <xsl:otherwise>
          <jurisinfo:courtname>
            <xsl:apply-templates select="@* | node()"/>
          </jurisinfo:courtname>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:courtcode[not($streamID = ('NZ03', 'AU09'))]
    Documentation

    Description

    case:courtcode is mapped to the target:

    • jurisinfo:courtinfo/jurisinfo:alternatecourtcode/@alternatecourtcode
    • doc:metadata/doc:docinfo/doc:legacy-metadata[metadatasource="lbu-meta"]/meta/metaitem. The attributes of metaitem are populated as follows:
      • metaitem/@name should be set to "case:courtcode".
      • metaitem/@value should be set to the value of case:courtcode.

    For Canada Specific only

    case:courtcode becomes doc:metadata/doc:docinfo/doc:legacy-metadata[metadatasource="lbu-meta"]/meta/metaitem. The attributes of metaitem are populated as follows:

    • metaitem/@name should be set to "case:courtcode".
    • metaitem/@value should be set to the value of case:courtcode.

    Example: CA content

     <case:courtcode ln.user-displayed="false">NSSC</case:courtcode> 
    becomes
     <doc:metadata> <doc:docinfo doc-content-country="CA"> ... <doc:legacy-metadata
    					metadatasource="lbu-meta"> <meta> ... <metaitem name="case:courtcode" value="NSSC"/>
    					</meta> </doc:legacy-metadata> </doc:docinfo> </doc:metadata> 

    Example: AU content

     <case:courtinfo> <case:courtcode>FCA</case:courtcode> ... </case:courtinfo> 
    becomes
     <jurisinfo:courtinfo> <jurisinfo:alternatecourtcode alternatecourtcode="FCA" />
    					</jurisinfo:courtinfo> ... <doc:legacy-metadata metadatasource="lbu-meta"> <meta>
    					<metaitem name="case:courtcode" value="FCA">  </meta> </doc:legacy-metadata> 

    Example: NZ content

     <case:courtinfo> <case:courtcode>NZCA</case:courtcode> ... </case:courtinfo> 
    becomes
     <jurisinfo:courtinfo> <jurisinfo:alternatecourtcode alternatecourtcode="NZCA" />
    					</jurisinfo:courtinfo> <doc:legacy-metadata metadatasource="lbu-meta"> <meta> <metaitem
    					name="case:courtcode" value="NZCA">  </meta> </doc:legacy-metadata> 

    Example: UK content

     <case:courtcode>CA</case:courtcode> 
    becomes
     <jurisinfo:courtinfo> <jurisinfo:alternatecourtcode alternatecourtcode="CA"/>
    					</jurisinfo:courtinfo> ... <doc:metadata> <doc:docinfo doc-content-country="GB"> ...
    					<doc:legacy-metadata metadatasource="lbu-meta"> <meta> ... <metaitem name="case:courtcode"
    					value="CA"/> </meta> </doc:legacy-metadata> </doc:docinfo> </doc:metadata>
    				

    Description

     Already Done 
     <topicref href="../../common_caselaw/Rosetta_case.courtcode.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.courtcode.dita  
    Namespace No namespace
    Match case:courtcode[not($streamID = ('NZ03', 'AU09'))]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:courtcode[not($streamID = ('NZ03', 'AU09'))]">
      <!--  Original Target XPath:  jurisinfo:courtinfo/jurisinfo:alternatecourtcode/@alternatecourtcode   -->
      <!-- Awantika: 2017-10-30- Updated for AU01 where colon (:) was coming between case:courtcode and case:judges which was coming inside caseinfo:caseinfo
    		which caused validation error-->
      <jurisinfo:alternatecourtcode>
        <xsl:attribute name="alternatecourtcode">
          <xsl:choose>
            <xsl:when test="$streamID = 'CA01'">
              <xsl:value-of select="following-sibling::abbrvname"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:apply-templates select="@* | node()"/>
              <xsl:if test="normalize-space(following-sibling::text()[1]) = ':' and $streamID='AU01'">
                <xsl:value-of select="following-sibling::text()[1]"/>
              </xsl:if>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
      </jurisinfo:alternatecourtcode>
    </xsl:template>
    Template text()[preceding-sibling::*[1][local-name()='courtcode']][normalize-space(.)=':'][$streamID='AU01']
    Documentation

    Description

     Awantika: 2017-10-30- Updated for AU01 where colon (:) was coming between case:courtcode and case:judges which was coming inside caseinfo:caseinfo
    		which caused validation error
    Namespace No namespace
    Match text()[preceding-sibling::*[1][local-name()='courtcode']][normalize-space(.)=':'][$streamID='AU01']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text()[preceding-sibling::*[1][local-name()='courtcode']][normalize-space(.)=':'][$streamID='AU01']"/>
    Template case:courtcode[$streamID = ('NZ03', 'AU09')]
    Documentation

    Description

    Satbir: Created separate template for NZ03 because case:courtcode comes double times single input
    Namespace No namespace
    Match case:courtcode[$streamID = ('NZ03', 'AU09')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:courtcode[$streamID = ('NZ03', 'AU09')]">
      <xsl:choose>
        <xsl:when test="not(following-sibling::case:courtcode)">
          <jurisinfo:alternatecourtcode>
            <xsl:attribute name="alternatecourtcode">
              <xsl:value-of select="//case:courtcode[last()]"/>
            </xsl:attribute>
          </jurisinfo:alternatecourtcode>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="@* | node() except text()"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:dates
    Documentation

    Description

    • case:dates becomes /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates

      Note: Conversion should not create consecutive caseinfo:caseinfo elements. When 2 or more consecutive sibling source elements map to caseinfo:caseinfo, data should be merged to a single caseinfo:caseinfo element unless this would hamper content ordering.

      • case:hearingdates becomes /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates/decision:argueddate

        Note: This likely not a complete date, rather just a day. Do not attempt to place a complete date if there is not sufficient content in source (year, month and day). It should remain PCDATA. See example.

      • case:decisiondate becomes /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates/decision:decisiondate populated with below mentioned attributes: case:decisiondate/date/@day becomes decision:decisiondate/@day, case:decisiondate/date/@month becomes decision:decisiondate/@month and case:decisiondate/date/@year becomes decision:decisiondate/@year

        The attribute decision:decisiondate/@normdate should be populated with the values of case:decisiondate/date/@year, case:decisiondate/date/@month and case:decisiondate/date/@day concatenated and separated by a single hyphen. The values of case:decisiondate/date/@month and case:decisiondate/date/@day should be padded with zeroes so that they are 2 digits.

        Note: If one or more of the three date values (year, month or day) are absent, then decision:decisiondate/@normdate should not be populated.

        • date becomes /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates/decision:decisiondate/date-text
        
          <case:dates>
            <case:hearingdates>8, </case:hearingdates>
            <case:decisiondate>
              <date day="20" month="05" year="2009">20 May 2009</date>
            </case:decisiondate>
          </case:dates>
        Becomes
        
          <decision:dates>
            <decision:argueddate>8, </decision:argueddate>
            <decision:decisiondate day="20" month="05" year="2009" normdate="2009-05-20">
              <date-text>20 May 2009</date-text>
            </decision:decisiondate>
          </decision:dates>
        
        Example where complete date occurs within case:hearingdate:
        
        <case:hearingdates>
          <date day="12" month="05" year="2000">12 May 2000</date>
        </case:hearingdates>
        
        Becomes
        
        <decision:argueddate day="12" month="05" year="2000">
          <date-text>12 May 2000</date-text>
        </decision:argueddate>
        

        Note: when @ln.user-displayed="false“ appears on a date element (i.e, case:decisiondate/@ln.user-displayed="false"), that element is translated into the target but with the element content omitted. Only the attributes are populated. So there is no display content.

        
        <case:dates>
          <case:decisiondate ln.user-displayed="false">
            <date year="1995" month="04" day="28">28 April 1995</date> 
          </case:decisiondate>
        </case:dates>
        
        Becomes
        
        <decision:dates>  
          <decision:decisiondate day="28" month="04" year="1995" normdate="1995-04-28"/>
        </decision:dates>
        
        
      • case:publishdate becomes decision:releaseddate
        
        <case:dates>
          ...
          <case:publishdate>; Date of publication of reasons: 7 July 2009</case:publishdate>
        </case:dates>
        Becomes
        
        <decision:dates>
          ...
          <decision:releaseddate>; Date of publication of reasons: 7 July 2009</decision:releaseddate>
        </decision:dates>
        
      • case:reviseddate becomes /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates/decision:revisiondate populated with below mentioned attributes: case:reviseddate/date/@day becomes decision:revisiondate/@day, case:reviseddate/date/@month becomes decision:revisiondate/@month and case:reviseddate/date/@year becomes decision:revisiondate/@year
        • date becomes /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates/decision:revisiondate/date-text
        
        <case:dates>
          <case:hearingdates>10–12 August</case:hearingdates>
          <case:decisiondate>
            <date day="16" month="09" year="2005">, 16 September 2005</date>
          </case:decisiondate>
          <case:reviseddate>
            <date day="22" month="09" year="2005">, 22 September 2005</date>
          </case:reviseddate>
        </case:dates>
        
        Becomes
        
        <decision:dates>
          <decision:argueddate>10–12 August</decision:argueddate>
          <decision:decisiondate day="16" month="09" year="2005" normdate="2005-09-16">, 
            <date-text>16 September 2005</date-text>
          </decision:decisiondate>
          <decision:revisiondate day="22" month="09" year="2005">, 
            <date-text>22 September 2005</date-text>
          </decision:revisiondate>
        </decision:dates>
        
        

      Note: The formatting of the date-text should not be normalized to YYYY-MM-DD. The attributes are used for normalization, but the element content should remain the same but whitespace and comma should retain outside the date-text element.


    Description

     Awantika: Completed- already done some templates 
     <topicref href="AU01_Rosetta_case.dates.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.dates.dita  
    Namespace No namespace
    Match case:dates
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:dates">
      <!--  Original Target XPath:  /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates   -->
      <!-- NOTE: it is assumed that this template will be called from whatever generates required parent wrapper elements -->
      <xsl:choose>
        <xsl:when test="parent::case:judgments">
          <xsl:apply-templates select="case:decisiondate"/>
        </xsl:when>
        <xsl:otherwise>
          <decision:dates>
            <xsl:apply-templates select="@* | node()"/>
          </decision:dates>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:hearingdates
    Namespace No namespace
    Match case:hearingdates
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:hearingdates">
      <!--  Original Target XPath:  /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates/decision:argueddate   -->
      <decision:argueddate>
        <xsl:if test="./date/@year">
          <xsl:attribute name="year" select="./date/@year"/>
        </xsl:if>
        <xsl:if test="./date/@month">
          <xsl:attribute name="month" select="./date/@month"/>
        </xsl:if>
        <xsl:if test="./date/@day">
          <xsl:attribute name="day" select="./date/@day"/>
        </xsl:if>
        <xsl:if test="./date/@day and ./date/@month and ./date/@year">
          <xsl:attribute name="normdate" select="concat(./date/@year,'-',./date/@month,'-',./date/@day)"/>
        </xsl:if>
        <xsl:if test="@ln.user-displayed !='false' or not(@ln.user-displayed)">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:if>
      </decision:argueddate>
    </xsl:template>
    Template case:decisiondate
    Namespace No namespace
    Match case:decisiondate
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:decisiondate">
      <decision:decisiondate>
        <xsl:if test="./date/@year">
          <xsl:attribute name="year" select="./date/@year"/>
        </xsl:if>
        <xsl:if test="./date/@month">
          <xsl:attribute name="month" select="./date/@month"/>
        </xsl:if>
        <xsl:if test="./date/@day">
          <xsl:attribute name="day" select="./date/@day"/>
        </xsl:if>
        <xsl:if test="./date/@day and ./date/@month and ./date/@year">
          <xsl:attribute name="normdate" select="concat(./date/@year,'-',./date/@month,'-',./date/@day)"/>
        </xsl:if>
        <xsl:if test="@ln.user-displayed !='false' or not(@ln.user-displayed)">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:if>
      </decision:decisiondate>
    </xsl:template>
    Template case:publishdate
    Documentation

    Description

     NOTE: probably belongs in a nonamespace module 
     NOTE: source <date> attributes must be moved to target parent of <date-text> (see templates in this file) 
    	<xsl:template match="date">
    		<date-text>
    			<xsl:apply-templates select="node()"/>
    		</date-text>
    	</xsl:template>
    Namespace No namespace
    Match case:publishdate
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:publishdate">
      <!--  Original Target XPath:  decision:releaseddate   -->
      <decision:releaseddate>
        <xsl:if test="./date/@year">
          <xsl:attribute name="year" select="./date/@year"/>
        </xsl:if>
        <xsl:if test="./date/@month">
          <xsl:attribute name="month" select="./date/@month"/>
        </xsl:if>
        <xsl:if test="./date/@day">
          <xsl:attribute name="day" select="./date/@day"/>
        </xsl:if>
        <xsl:if test="./date/@day and ./date/@month and ./date/@year">
          <xsl:attribute name="normdate" select="concat(./date/@year,'-',./date/@month,'-',./date/@day)"/>
        </xsl:if>
        <xsl:if test="@ln.user-displayed !='false' or not(@ln.user-displayed)">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:if>
      </decision:releaseddate>
    </xsl:template>
    Template case:reviseddate
    Namespace No namespace
    Match case:reviseddate
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:reviseddate">
      <!--  Original Target XPath:  /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/decision:dates/decision:revisiondate   -->
      <decision:revisiondate>
        <xsl:if test="./date/@year">
          <xsl:attribute name="year" select="./date/@year"/>
        </xsl:if>
        <xsl:if test="./date/@month">
          <xsl:attribute name="month" select="./date/@month"/>
        </xsl:if>
        <xsl:if test="./date/@day">
          <xsl:attribute name="day" select="./date/@day"/>
        </xsl:if>
        <xsl:if test="./date/@day and ./date/@month and ./date/@year">
          <xsl:attribute name="normdate" select="concat(./date/@year,'-',./date/@month,'-',./date/@day)"/>
        </xsl:if>
        <xsl:if test="@ln.user-displayed !='false' or not(@ln.user-displayed)">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:if>
      </decision:revisiondate>
    </xsl:template>
    Template case:courtloc
    Documentation

    Description

    Note: Conversion should not create consecutive caseinfo:caseinfo elements. When 2 or more consecutive sibling source elements map to caseinfo:caseinfo, data should be merged to a single caseinfo:caseinfo element unless this would hamper content ordering.

    <case:courtinfo>
      <case:courtname>FEDERAL COURT OF AUSTRALIA</case:courtname>
      <case:courtcode>FCA</case:courtcode>  - will be moved under doc:legacy-metadata.
      <case:courtloc>Sydney</case:courtloc>
    </case:courtinfo>
           
    becomes
    <courtcase:head>
      <caseinfo:caseinfo>
        <jurisinfo:courtinfo>
          <jurisinfo:courtname>FEDERAL COURT OF AUSTRALIA</jurisinfo:courtname>
          <jurisinfo:jurisdiction>
            <jurisinfo:location>
              <location:city>Sydney</location:city>
            </jurisinfo:location>
          </jurisinfo:jurisdiction>
        </jurisinfo:courtinfo>
      </caseinfo:caseinfo>
    </courtcase:head>
           

    Note: Connecting punctuation and text must be captured by using connector within jurisinfo:location.

    <case:courtinfo>
        <case:courtname>COMMERCIAL TRIBUNAL OF NEW SOUTH WALES</case:courtname> 
        <case:courtcode>NSWSC</case:courtcode> 
        <case:judges>
            Deputy Chairman 
            <case:judge>Vermeesch</case:judge> 
        </case:judges>
        <case:dates>
            <case:decisiondate>
                <date day="19" month="12" year="1994">19 December 1994</date> 
            </case:decisiondate>
        </case:dates>
        — 
        <case:courtloc>Sydney</case:courtloc> 
        <case:juris>nsw</case:juris> 
    </case:courtinfo>
           
    becomes
    <jurisinfo:courtinfo>
        <jurisinfo:courtname>COMMERCIAL TRIBUNAL OF NEW SOUTH WALES</jurisinfo:courtname>
        <jurisinfo:jurisdiction>
            <jurisinfo:location>
                <connector>
                —
                </connector>
                <location:city>Sydney</location:city>
            </jurisinfo:location>
        </jurisinfo:jurisdiction>
    </jurisinfo:courtinfo>
           

    Description

     Awantika: Complete 
     <topicref href="AU01_Rosetta_case.courtloc-LxAdv_jurisinfo.jurisdiction_jurisinfo.location.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.courtloc-LxAdv_jurisinfo.jurisdiction_jurisinfo.location.dita  
    Namespace No namespace
    Match case:courtloc
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:courtloc">
      <jurisinfo:location>
        <!-- Awantika: CI doesn't have any instruction for how to mark the content in city or state or country. DT is outputting city always following the same -->
        <location:city>
          <xsl:apply-templates select="@* | node()"/>
        </location:city>
      </jurisinfo:location>
    </xsl:template>
    Template case:juris[starts-with(upper-case(.),'NSW') or starts-with(upper-case(.),'QLD') or starts-with(upper-case(.),'SA') or starts-with(upper-case(.),'TAS') or starts-with(upper-case(.),'VIC') or starts-with(upper-case(.),'WA') or starts-with(upper-case(.),'ACT') or starts-with(upper-case(.),'NT') or starts-with(upper-case(.),'CTH') or starts-with(lower-case(.),'cth') or starts-with(lower-case(.),'fj') or starts-with(lower-case(.),'uk') or starts-with(lower-case(.),'nz') or starts-with(lower-case(.),'can') or starts-with(lower-case(.),'sg')or starts-with(lower-case(.),'us')]
    Documentation

    Description

    • case:juris can have State/Territory code or Country code.
    • When case:juris has State/Territory code: case:juris becomes jurisinfo:courtinfo/jurisinfo:jurisdiction/jurisinfo:system and create dc:metadata/dc:coverage/location:state with attributes @codescheme="ISO-3166-2" and @statecode, value for this attribute will be picked from the below mentioned pick list:
    • AU-NS : New South Wales (NSW)
    • AU-QL : Queensland (QLD)
    • AU-SA : South Australia (SA)
    • AU-TS : Tasmania (TAS)
    • AU-VI : Victoria (VIC)
    • AU-WA : Western Australia (WA)
    • AU-CT : Australian Capital Territory (ACT)
    • AU-NT : Northern Territory (NT)
    • and the value for jurisinfo:courtinfo/jurisinfo:alternatecourtcode/@alternatecourtcode will be picked up from case:courtcode.
      
      <case:courtinfo>
        ...
        <case:courtcode>NSWSC</case:courtcode>
        ...
        <case:juris>nsw</case:juris>
      </case:courtinfo>
      Becomes
      
      <jurisinfo:courtinfo>
        <jurisinfo:alternatecourtcode alternatecourtcode="NSWSC" />
        <jurisinfo:jurisdiction>
          <jurisinfo:system>nsw</jurisinfo:system>
        </jurisinfo:jurisdiction>
      </jurisinfo:courtinfo>
      
      <dc:metadata>
        <dc:coverage>
          <location:state codescheme="ISO-3166-2" statecode="AU-NS"/>
        </dc:coverage>
      </dc:metadata>
      
      
    • When case:juris has Country code:

      Note: If value for case:juris is "CTH" then case:juris will become jurisinfo:courtinfo/jurisinfo:jurisdiction/jurisinfo:system and create dc:metadata/dc:coverage/location:country with attributes @codescheme="ISO-3166-1" and @countrycode="AU".

      <case:juris>CTH</case:juris>
      
      Becomes
                    
      <jurisinfo:courtinfo>
        <jurisinfo:jurisdiction>
          <jurisinfo:system>CTH</jurisinfo:system>
        </jurisinfo:jurisdiction>
      </jurisinfo:courtinfo>
      
      <dc:metadata>
        <dc:coverage>
          <location:country codescheme="ISO-3166-1" countrycode="AU"/>
        </dc:coverage>
      </dc:metadata>
      

      Note: The ordering of the jurisinfo:alternatecourtcode and jurisinfo:jurisdiction\jurisinfo:system is not significant in terms of display.


    Description

     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.juris.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.juris.dita  
     Awantika: 2017-11-01- Added fj value as AU-FJ source has fj value in case:juris 
     Awantika: 2017-11-07- Added markup for uk,can,nz in case:juris. Webstar # 7041469  
     Ankita : 20-12-2017- Added markup for "us" in case:juris . Webtar# 7071460 
    Namespace No namespace
    Match case:juris[starts-with(upper-case(.),'NSW') or starts-with(upper-case(.),'QLD') or starts-with(upper-case(.),'SA') or starts-with(upper-case(.),'TAS') or starts-with(upper-case(.),'VIC') or starts-with(upper-case(.),'WA') or starts-with(upper-case(.),'ACT') or starts-with(upper-case(.),'NT') or starts-with(upper-case(.),'CTH') or starts-with(lower-case(.),'cth') or starts-with(lower-case(.),'fj') or starts-with(lower-case(.),'uk') or starts-with(lower-case(.),'nz') or starts-with(lower-case(.),'can') or starts-with(lower-case(.),'sg')or starts-with(lower-case(.),'us')]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:juris[starts-with(upper-case(.),'NSW') or starts-with(upper-case(.),'QLD') or starts-with(upper-case(.),'SA') or starts-with(upper-case(.),'TAS') or starts-with(upper-case(.),'VIC') or starts-with(upper-case(.),'WA') or starts-with(upper-case(.),'ACT') or starts-with(upper-case(.),'NT') or starts-with(upper-case(.),'CTH') or starts-with(lower-case(.),'cth') or starts-with(lower-case(.),'fj') or starts-with(lower-case(.),'uk') or starts-with(lower-case(.),'nz') or starts-with(lower-case(.),'can') or starts-with(lower-case(.),'sg')or starts-with(lower-case(.),'us')]">
      <!-- TODO: check that jurisinfo:courtinfo is created from case:courtinfo -->
      <!--<jurisinfo:courtinfo-->
      <!--	<xsl:apply-templates select="preceding-sibling::case:courtcode[1]"/>-->
      <jurisinfo:jurisdiction>
        <jurisinfo:system>
          <xsl:apply-templates select="@* | node()"/>
        </jurisinfo:system>
        <xsl:apply-templates select="case:courtloc"/>
        <!--<xsl:apply-templates select="preceding-sibling::case:courtloc[$streamID='AU01']"/>-->
      </jurisinfo:jurisdiction>
      <!--</jurisinfo:courtinfo>-->
    </xsl:template>
    Template case:juris[starts-with(upper-case(.),'NSW') or starts-with(upper-case(.),'QLD') or starts-with(upper-case(.),'SA') or starts-with(upper-case(.),'TAS') or starts-with(upper-case(.),'VIC') or starts-with(upper-case(.),'WA') or starts-with(upper-case(.),'ACT') or starts-with(upper-case(.),'NT') or starts-with(lower-case(.),'fj')]metadata
    Documentation

    Description

     Awantika: common module of case:courtcode is already created 
    <xsl:template match="case:courtcode">
    		<jurisinfo:alternatecourtcode alternatecourtcode="{.}" />
    	</xsl:template>
    Namespace No namespace
    Match case:juris[starts-with(upper-case(.),'NSW') or starts-with(upper-case(.),'QLD') or starts-with(upper-case(.),'SA') or starts-with(upper-case(.),'TAS') or starts-with(upper-case(.),'VIC') or starts-with(upper-case(.),'WA') or starts-with(upper-case(.),'ACT') or starts-with(upper-case(.),'NT') or starts-with(lower-case(.),'fj')]
    Mode metadata
    Import precedence 0
    Source
    <xsl:template match="case:juris[starts-with(upper-case(.),'NSW') or starts-with(upper-case(.),'QLD') or starts-with(upper-case(.),'SA') or starts-with(upper-case(.),'TAS') or starts-with(upper-case(.),'VIC') or starts-with(upper-case(.),'WA') or starts-with(upper-case(.),'ACT') or starts-with(upper-case(.),'NT') or starts-with(lower-case(.),'fj')]" mode="metadata">
      <dc:coverage>
        <location:state codescheme="ISO-3166-2">
          <xsl:attribute name="statecode">
            <xsl:choose>
              <xsl:when test="starts-with(upper-case(.),'NSW')">
                <xsl:value-of select="'AU-NS'"/>
              </xsl:when>
              <xsl:when test="starts-with(upper-case(.),'QLD')">
                <xsl:value-of select="'AU-QL'"/>
              </xsl:when>
              <xsl:when test="starts-with(upper-case(.),'SA')">
                <xsl:value-of select="'AU-SA'"/>
              </xsl:when>
              <xsl:when test="starts-with(upper-case(.),'TAS')">
                <xsl:value-of select="'AU-TS'"/>
              </xsl:when>
              <xsl:when test="starts-with(upper-case(.),'VIC')">
                <xsl:value-of select="'AU-VI'"/>
              </xsl:when>
              <xsl:when test="starts-with(upper-case(.),'WA')">
                <xsl:value-of select="'AU-WA'"/>
              </xsl:when>
              <xsl:when test="starts-with(upper-case(.),'ACT')">
                <xsl:value-of select="'AU-CT'"/>
              </xsl:when>
              <xsl:when test="starts-with(upper-case(.),'NT')">
                <xsl:value-of select="'AU-NT'"/>
              </xsl:when>
              <xsl:when test="starts-with(upper-case(.),'FJ')">
                <xsl:value-of select="'AU-FJ'"/>
              </xsl:when>
              <!--<xsl:when test="starts-with(upper-case(.),'SG')"><xsl:value-of select="'AU-SG'"/></xsl:when>-->
            </xsl:choose>
          </xsl:attribute>
          <!--<xsl:apply-templates />-->
        </location:state>
      </dc:coverage>
    </xsl:template>
    Template case:juris[starts-with(upper-case(.),'CTH') or starts-with(lower-case(.),'cth')or starts-with(lower-case(.),'uk') or starts-with(lower-case(.),'nz') or starts-with(lower-case(.),'can') or starts-with(lower-case(.),'sg')or starts-with(lower-case(.),'us')]metadata
    Documentation

    Description

    <xsl:template match="case:juris[starts-with(upper-case(.),'CTH') or starts-with(lower-case(.),'cth')]" mode="metadata" priority="20">
    		<!-\-<jurisinfo:courtinfo>-\->
    		<jurisinfo:jurisdiction>
    			<jurisinfo:system>
    				<xsl:apply-templates select="@* | node()"/>
    			</jurisinfo:system>
    		</jurisinfo:jurisdiction>
    		<!-\-</jurisinfo:courtinfo>-\->
    	</xsl:template>
    Namespace No namespace
    Match case:juris[starts-with(upper-case(.),'CTH') or starts-with(lower-case(.),'cth')or starts-with(lower-case(.),'uk') or starts-with(lower-case(.),'nz') or starts-with(lower-case(.),'can') or starts-with(lower-case(.),'sg')or starts-with(lower-case(.),'us')]
    Mode metadata
    Import precedence 0
    Priority 20
    Source
    <xsl:template match="case:juris[starts-with(upper-case(.),'CTH') or starts-with(lower-case(.),'cth')or starts-with(lower-case(.),'uk') or starts-with(lower-case(.),'nz') or starts-with(lower-case(.),'can') or starts-with(lower-case(.),'sg')or starts-with(lower-case(.),'us')]" mode="metadata" priority="20">
      <dc:coverage>
        <xsl:choose>
          <xsl:when test="starts-with(upper-case(.),'CTH') or starts-with(lower-case(.),'cth')">
            <location:country codescheme="ISO-3166-1">
              <xsl:attribute name="countrycode">
                <xsl:value-of select="'AU'"/>
              </xsl:attribute>
            </location:country>
          </xsl:when>
          <xsl:when test="starts-with(lower-case(.),'uk')">
            <location:country codescheme="ISO-3166-2">
              <xsl:attribute name="countrycode">
                <xsl:value-of select="'UK'"/>
              </xsl:attribute>
            </location:country>
          </xsl:when>
          <xsl:when test="starts-with(lower-case(.),'can')">
            <location:country codescheme="ISO-3166-1">
              <xsl:attribute name="countrycode">
                <xsl:value-of select="'CA'"/>
              </xsl:attribute>
            </location:country>
          </xsl:when>
          <xsl:when test="starts-with(lower-case(.),'sg')">
            <location:country codescheme="ISO-3166-1">
              <xsl:attribute name="countrycode">
                <xsl:value-of select="'SG'"/>
              </xsl:attribute>
            </location:country>
          </xsl:when>
          <xsl:when test="starts-with(lower-case(.),'us')">
            <location:country codescheme="ISO-3166-1">
              <xsl:attribute name="countrycode">
                <xsl:value-of select="'US'"/>
              </xsl:attribute>
            </location:country>
          </xsl:when>
          <xsl:when test="starts-with(lower-case(.),'nz')">
            <location:country codescheme="ISO-3166-1">
              <xsl:attribute name="countrycode">
                <xsl:value-of select="'NZ'"/>
              </xsl:attribute>
            </location:country>
          </xsl:when>
        </xsl:choose>
      </dc:coverage>
      <!--</jurisinfo:courtinfo>-->
    </xsl:template>
    Template case:courtcite
    Documentation

    Description

    case:courtcite conversion depends upon its child elements, refer below scenarios:

    When ci:cite/@type="parallel" is a child of case:courtcite then its become ref:parallelcite/@citetype="court".

    <case:courtcite>
        <ci:cite type="parallel">
            <ci:content>THE STATE OF WESTERN AUSTRALIA -v- A F [2014] WADC 124</ci:content>
        </ci:cite>
    </case:courtcite>
    
    becomes
    <ref:parallelcite citetype="court">
        <lnci:cite>
            <lnci:content>THE STATE OF WESTERN AUSTRALIA -v- A F [2014] WADC 124</lnci:content>
        </lnci:cite>
    </ref:parallelcite>
               

    When ci:cite/@type="cite4thisdoc" is a child of case:courtcite then its become ref:cite4thisresource/@citetype="court".

    <case:courtcite>
        <ci:cite type="cite4thisdoc">
            <ci:content>Maritime Union of Australia v Geraldton Port Authority [2000] FCA
                16</ci:content>
        </ci:cite>
    </case:courtcite>
    
    becomes
    <ref:cite4thisresource citetype="court">
        <lnci:cite>
            <lnci:content>Maritime Union of Australia v Geraldton Port Authority [2000] FCA
                16</lnci:content>
        </lnci:cite>
    </ref:cite4thisresource>
               

    When @type attribute is not present in the ci:cite element then case:courtcite becomes ref:cite4thisresource/@citetype="court"

    <case:courtcite>
        <ci:cite>
            <ci:content>Le Brun (An Incapable Person Suing By His Next Friend Elaine Le Brun) v Joseph
                and Ors [2006] WADC 200</ci:content>
        </ci:cite>
    </case:courtcite>
    
    becomes
    <ref:cite4thisresource citetype="court">
        <lnci:cite>
            <lnci:content>Le Brun (An Incapable Person Suing By His Next Friend Elaine Le Brun) v Joseph
                and Ors [2006] WADC 200</lnci:content>
        </lnci:cite>
    </ref:cite4thisresource>
               

    Note: If case:courtcite/ci:cite/@type="cite4thisdoc" then duplicate all the ref:para in the document using the lnci:au@courtcode value in @para-scheme and @paraschemetype="court-code". For more clarification please refer the example below.

                SOURCE XML
    
    <case:courtcite>
        <ci:cite type="cite4thisdoc">
            <ci:case>
                <ci:caseinfo>
                    <ci:opinionnum num="201"/>
                    <ci:jurisinfo>
                        <ci:au courtcode="nswca"/>
                    </ci:jurisinfo>
                    <ci:decisiondate year="2008"/>
                </ci:caseinfo>
            </ci:case>
            <ci:content>[2008] NSWCA 201</ci:content>
        </ci:cite>
    </case:courtcite>
    
               
    becomes
    <ref:citations>    
        <ref:cite4thisresource citetype="court">        
            <lnci:cite>            
                <lnci:case>                
                    <lnci:caseinfo>                    
                        <lnci:opinionnum num="201"/>                    
                        <lnci:jurisinfo>                        
                            <lnci:au courtcode="nswca"/>                        
                        </lnci:jurisinfo>                    
                        <lnci:decisiondate year="2008"/>                    
                    </lnci:caseinfo>                
                </lnci:case>            
                <lnci:content>[2008] NSWCA 201</lnci:content>            
            </lnci:cite>        
        </ref:cite4thisresource>    
    </ref:citations>
    
    and
    
    <ref:para num="1" para-scheme="nswlr" para-scheme-type="reporter-abbreviation">[1]</ref:para>
    <ref:para num="1" para-scheme="nswca" para-scheme-type="court-code"/>  
    
    
                

    Description

    	<xsl:template match="case:juris" mode="metadata">
    		<dc:coverage>
    			<location:country>
    				<xsl:attribute name="countrycode" select="'AU'"/>
    				<xsl:attribute name="codescheme">ISO-3166-2</xsl:attribute>       
    			</location:country>						
    		</dc:coverage>
    	</xsl:template>
    
     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.courtcite-LxAdv_ref.cite4thisresource.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.courtcite-LxAdv_ref.cite4thisresource.dita  
    Namespace No namespace
    Match case:courtcite
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:courtcite">
      <xsl:if test="child::ci:cite[@type='parallel']">
        <ref:citations>
          <ref:parallelcite citetype="court">
            <xsl:apply-templates select="node() | @*"/>
          </ref:parallelcite>
        </ref:citations>
      </xsl:if>
    </xsl:template>
    Template case:courtcite[ci:cite[@type='cite4thisdoc' or not(@type)]]
    Namespace No namespace
    Match case:courtcite[ci:cite[@type='cite4thisdoc' or not(@type)]]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:courtcite[ci:cite[@type='cite4thisdoc' or not(@type)]]">
      <ref:citations>
        <ref:cite4thisresource citetype="court">
          <xsl:apply-templates select="node() | @*"/>
        </ref:cite4thisresource>
      </ref:citations>
    </xsl:template>
    Template case:libnum
    Documentation

    Description

    • case:libnum becomes jurisinfo:courtinfo/refnum/@refnumscheme="wa-AU-library-number"
      
      <case:info>
        ...
        <case:courtinfo>
          ...
          <case:filenum>No. CIV 1695 of 1993</case:filenum>
          <case:dates>
            <case:hearingdates>23 September 1996</case:hearingdates>
            <case:decisiondate>
              <date day="11" month="10" year="1996">, 11 October 1996< /date>
            </case:decisiondate>
          </case:dates>
          <case:libnum>960591</case:libnum>
          <case:juris>wa</case:juris>
        </case:courtinfo>
      </case:info>
      Becomes
      
      <caseinfo:caseinfo>
        ...
        <caseinfo:docketnum>No. CIV 1695 of 1993</caseinfo:docketnum>
        <jurisinfo:courtinfo>
          <jurisinfo:courtname>SUPREME COURT OF WESTERN AUSTRALIA IN CHAMBERS</jurisinfo:courtname>
          <refnum refnumscheme="wa-AU-library-number">960591</refnum>
        </jurisinfo:courtinfo>
        <decision:dates>
          <decision:argueddate>23 September 1996</decision:argueddate>
          <decision:decisiondate day="11" month="10" year="1996">, 
            <datetext>11 October 1996</datetext>
          </decision:decisiondate>
        </decision:dates>
      </caseinfo:caseinfo>
      
      

    Description

    <xsl:template match="case:courtcite[ci:cite[@type='parallel']]">
    	    <ref:citations>
    	    <ref:parallelcite citetype="court">
    			<xsl:apply-templates select="node() | @*"/>
    		</ref:parallelcite>
    	    </ref:citations>
    	</xsl:template>
    
    
    	<xsl:template match="case:courtcite[ci:cite[@type='cite4thisdoc' or not(@type)]]">
    	    <ref:citations>
    	    <ref:cite4thisresource citetype="court">
    			<xsl:apply-templates select="node() | @*"/>
    		</ref:cite4thisresource>
    	    </ref:citations>
    	</xsl:template>
     TODO: implement DITA <note> above:
    	If case:courtcite/ci:cite[@type="cite4thisdoc"] then duplicate all the ref:para in the document using the lnci:au@courtcode 
    	value in @para-scheme and @paraschemetype="court-code". For more clarification please refer the example below. 
    	
     Already: Completed 
     <topicref href="AU01_Rosetta_case.libnum-LxAdv_refnum-refnumscheme.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.libnum-LxAdv_refnum-refnumscheme.dita  
    Namespace No namespace
    Match case:libnum
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:libnum">
      <!--  Original Target XPath:  jurisinfo:courtinfo/refnum/@refnumscheme="wa-AU-library-number"   -->
      <!-- assume jurisinfo:courtinfo wrapper created elsewhere -->
      <!--<jurisinfo:courtinfo>-->
      <refnum refnumscheme="wa-AU-library-number">
        <xsl:apply-templates/>
      </refnum>
      <!--</jurisinfo:courtinfo>-->
    </xsl:template>
    Template catchwordgrp
    Documentation

    Description

    catchwordgrp is a container element that should be omitted, but its content should be retained and converted as follows:

    • catchwordgrp/heading becomes caseinfo:caseinfo/classify:classification/heading.
    • catchwordgrp/catchwords becomes caseinfo:caseinfo/classify:classification with the value of classify:classification/@classscheme set to "catchwords". Each instance of catchwords should be converted to its own classify:classification[@classscheme="catchwords"] element. The children of catchwords are converted as follows:
      • catchwords/catchphrase becomes classify:classification/classify:classitem/classify:classitem-identifier/classify:classname.

    Note: Conversion should not create consecutive caseinfo:caseinfo elements. When 2 or more consecutive sibling source elements map to caseinfo:caseinfo, data should be merged to a single caseinfo:caseinfo element unless this would hamper content ordering.

    Note: Exception for Pacific Content (AU): If nl occur within catchwords/catchphrase then conversion should replace the nl with a space.

    Example: CA content

     <catchwordgrp> <catchwords> <catchphrase>Zoning by-laws</catchphrase>
    					<catchphrase>Defendant's commercial greenhouse not permitted under prior by-law and therefore not a
    					continuing non-conforming legal use</catchphrase> <catchphrase>Municipality having right to
    					enforce by-law by injunction</catchphrase> <catchphrase>Planning Act, R.S.P.E.I. 1974, c. P-6, ss.
    					46(1)(e), (f), (g), 49, 52, 56</catchphrase> <catchphrase>Municipalities Act, R.S.P.E.I. 1974, c.
    					M-15.1, s. 1(b).</catchphrase> </catchwords> </catchwordgrp> 
    becomes
     <classify:classification classscheme="catchwords"> <classify:classitem>
    					<classify:classitem-identifier> <classify:classname>Zoning by-laws</classify:classname>
    					</classify:classitem-identifier> </classify:classitem> <classify:classitem>
    					<classify:classitem-identifier> <classify:classname>Defendant's commercial greenhouse not
    					permitted under prior by-law and therefore not a continuing non-conforming legal
    					use</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					<classify:classitem> <classify:classitem-identifier> <classify:classname>Municipality having
    					right to enforce by-law by injunction</classify:classname> </classify:classitem-identifier>
    					</classify:classitem> <classify:classitem> <classify:classitem-identifier>
    					<classify:classname>Planning Act, R.S.P.E.I. 1974, c. P-6, ss. 46(1)(e), (f), (g), 49, 52,
    					56</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					<classify:classitem> <classify:classitem-identifier> <classify:classname>Municipalities Act,
    					R.S.P.E.I. 1974, c. M-15.1, s. 1(b).</classify:classname> </classify:classitem-identifier>
    					</classify:classitem> </classify:classification> 

    Example: CA content catchwordgrp with child heading

     <catchwordgrp> <heading> <title>Indexation :</title> </heading>
    					<catchwords> <catchphrase>Assurance</catchphrase> <catchphrase>Assurance
    					automobile</catchphrase> <catchphrase>Régime d'indemnisation sans égard à la
    					responsabilité</catchphrase> ... </catchwords> </catchwordgrp> 
    becomes
     <classify:classification classscheme="catchwords"> <heading> <title>Indexation
    					:</title> </heading> <classify:classitem> <classify:classitem-identifier>
    					<classify:classname>Assurance</classify:classname> </classify:classitem-identifier>
    					</classify:classitem> <classify:classitem> <classify:classitem-identifier>
    					<classify:classname>Assurance automobile</classify:classname>
    					</classify:classitem-identifier> </classify:classitem> <classify:classitem>
    					<classify:classitem-identifier> <classify:classname>Régime d'indemnisation sans égard à la
    					responsabilité</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					... </classify:classification> 

    Example: AU content

     <catchwordgrp> <catchwords> <catchphrase>Practice and
    					procedure</catchphrase> <catchphrase>Applications</catchphrase> <catchphrase>Applicant
    					sought declaration that insurance agents were independent contractors</catchphrase>
    					<catchphrase>Agents had already commenced proceedings in the Chief Industrial Magistrates Court of NSW
    					claiming entitlements</catchphrase> </catchwords> </catchwordgrp> 
    becomes
     <classify:classification classscheme="catchwords"> <classify:classitem>
    					<classify:classitem-identifier> <classify:classname>Practice and
    					procedure</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					<classify:classitem> <classify:classitem-identifier>
    					<classify:classname>Applications</classify:classname> </classify:classitem-identifier>
    					</classify:classitem> <classify:classitem> <classify:classitem-identifier>
    					<classify:classname>Applicant sought declaration that insurance agents were independent
    					contractors</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					<classify:classitem> <classify:classitem-identifier> <classify:classname>Agents had already
    					commenced proceedings in the Chief Industrial Magistrates Court of NSW claiming
    					entitlements</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					</classify:classification> 

    Example: NZ content

     <catchwordgrp> <catchwords> <catchphrase> <emph
    					typestyle="it">Deceit</emph> </catchphrase> <catchphrase> <emph
    					typestyle="it">Amendment of Declaration</emph> </catchphrase> <catchphrase> <emph
    					typestyle="it">Terms</emph> </catchphrase> <catchphrase> <emph
    					typestyle="it">Reservation of leave</emph> </catchphrase> <catchphrase> <emph
    					typestyle="it">New Trial</emph> </catchphrase> <catchphrase> <emph
    					typestyle="it">Two concurring verdicts</emph> </catchphrase> </catchwords>
    					</catchwordgrp> 
    becomes
     <classify:classification classscheme="catchwords"> <classify:classitem>
    					<classify:classitem-identifier> <classify:classname> <emph
    					typestyle="it">Deceit</emph> </classify:classname> </classify:classitem-identifier>
    					</classify:classitem> <classify:classitem> <classify:classitem-identifier>
    					<classify:classname> <emph typestyle="it">Amendment of Declaration</emph>
    					</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					<classify:classitem> <classify:classitem-identifier> <classify:classname> <emph
    					typestyle="it">Terms</emph> </classify:classname> </classify:classitem-identifier>
    					</classify:classitem> <classify:classitem> <classify:classitem-identifier>
    					<classify:classname> <emph typestyle="it">Reservation of leave</emph>
    					</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					<classify:classitem> <classify:classitem-identifier> <classify:classname> <emph
    					typestyle="it">New Trial</emph> </classify:classname> </classify:classitem-identifier>
    					</classify:classitem> <classify:classitem> <classify:classitem-identifier>
    					<classify:classname> <emph typestyle="it">Two concurring verdicts</emph>
    					</classify:classname> </classify:classitem-identifier> </classify:classitem>
    					</classify:classification> 

    Example: UK content

     <catchwordgrp> <catchwords> <catchphrase>Copyright &#x2013; Compilation
    					&#x2013; No evidence of any specific infringement &#x2013; Declaratory judgment &#x2013; Possible
    					infringement by documents not yet in existence &#x2013; RSC Ord XXV, r 5.</catchphrase>
    					</catchwords> </catchwordgrp> 
    becomes
     <classify:classification classscheme="catchwords"> <classify:classitem>
    					<classify:classitem-identifier> <classify:classname>Copyright &#x2013; Compilation
    					&#x2013; No evidence of any specific infringement &#x2013; Declaratory judgment &#x2013; Possible
    					infringement by documents not yet in existence &#x2013; RSC Ord XXV, r 5.</classify:classname>
    					</classify:classitem-identifier> </classify:classitem> </classify:classification>
    				

    Note: If the punctuation marks occuring between catchwords and catchphrase conversion should drop these punctuation in output this will be handle by stylesheet.

    Note: If the punctuation marks occuring inside the catchphrase then, these will be retain in output.

    Example: UK content, punctuation marks occuring between catchwords and catchphrase

     <catchwordgrp> <catchwords> ( <catchphrase>Comitology</catchphrase> —
    					<catchphrase>Council Decision 1999/468/EC laying down the procedures for the exercise of implementing
    					powers conferred on the Commission</catchphrase> — <catchphrase>Criteria for choosing between the
    					different procedures for adopting implementing measures</catchphrase> —
    					<catchphrase>Effects</catchphrase> — <catchphrase>Obligation to state
    					reasons</catchphrase> — <catchphrase>Annulment in part of Regulation (EC) No 1655/2000 of the
    					European Parliament and of the Council concerning the Financial Instrument for the Environment
    					(LIFE)</catchphrase> ) </catchwords> </catchwordgrp> becomes
    					<classify:classification classscheme="catchwords"> <classify:classitem>
    					<classify:classitem-identifier> <classify:classname>Comitology</classify:classname>
    					</classify:classitem-identifier> <classify:classitem-identifier> <classify:classname>Council
    					Decision 1999/468/EC laying down the procedures for the exercise of implementing powers conferred on the
    					Commission</classify:classname> </classify:classitem-identifier>
    					<classify:classitem-identifier> <classify:classname>Criteria for choosing between the different
    					procedures for adopting implementing measures</classify:classname>
    					</classify:classitem-identifier> <classify:classitem-identifier>
    					<classify:classname>Effects</classify:classname> </classify:classitem-identifier>
    					<classify:classitem-identifier> <classify:classname>Obligation to state
    					reasons</classify:classname> </classify:classitem-identifier>
    					<classify:classitem-identifier> <classify:classname>Annulment in part of Regulation (EC) No
    					1655/2000 of the European Parliament and of the Council concerning the Financial Instrument for the
    					Environment (LIFE)</classify:classname> </classify:classitem-identifier>
    					</classify:classitem> </classify:classification> 

    Description

     start topicref  ../../common_caselaw/Rosetta_catchwordgrp.dita  
     Already Done 
     <topicref href="../../common_caselaw/Rosetta_catchwordgrp.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_catchwordgrp.dita  
    Namespace No namespace
    Match catchwordgrp
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="catchwordgrp">
      <xsl:apply-templates select="node() except heading | @*"/>
    </xsl:template>
    Template catchwords
    Documentation

    Description

    <!-\- Vikas Rohilla: added for the streamID CA01	-\->
    	<xsl:template match="catchwordgrp[preceding-sibling::*[1][self::case:info]][$streamID='CA01']"/>
    	
    	<!-\- Vikas Rohilla: added for the streamID CA01	-\->
    	<xsl:template match="catchwordgrp[not(preceding-sibling::*[1][self::case:info])][$streamID='CA01']">
    		<caseinfo:caseinfo>
    			<xsl:apply-templates select="node() except heading | @*"/>
    		</caseinfo:caseinfo>
    	</xsl:template>
    	<!-\- Vikas Rohilla: added for the streamID CA01	-\->
    	<xsl:template match="case:headnote/catchwordgrp[$streamID='CA01']" mode="headnote-catchwordgrp">
    		<xsl:apply-templates select="node() except heading | @*"/>
    	</xsl:template>
    Namespace No namespace
    Match catchwords
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="catchwords">
      <!--  Original Target XPath:  caseinfo:caseinfo/classify:classification/heading   -->
      <!-- Sudhanshu 5 May 2017- implemented for CA01 -->
      <!--
    		<xsl:choose>
    			<xsl:when test="$streamID = 'CA01'">
    				<caseinfo:caseinfo>
    					<classify:classification>
    						<xsl:attribute name="classscheme">
    							<xsl:text>catchwords</xsl:text>
    						</xsl:attribute>
    						<xsl:apply-templates select="preceding-sibling::heading"/>
    						<xsl:apply-templates select="@* | node() except page"/>
    					</classify:classification>
    				</caseinfo:caseinfo>
    			</xsl:when>
    			<xsl:when test="$streamID = 'HK03'">
    					<classify:classification>
    						<xsl:attribute name="classscheme">
    							<xsl:text>catchwords</xsl:text>
    						</xsl:attribute>
    						<xsl:apply-templates select="preceding-sibling::heading"/>
    						<xsl:apply-templates select="@* | node() | child::page"/>
    					</classify:classification>
    			</xsl:when>
    			<xsl:otherwise>-->
      <!-- Awantika: 2017-10-30- checking for empty catchwords element, As catchwords is coming blank in source for AU01, 
    			therefore empty classify:classification is being created and thus resulting in validation -->
      <xsl:if test=".!=''">
        <classify:classification>
          <xsl:attribute name="classscheme">
            <xsl:text>catchwords</xsl:text>
          </xsl:attribute>
          <xsl:apply-templates select="preceding-sibling::heading"/>
          <xsl:apply-templates select="@* | node() except page"/>
        </classify:classification>
      </xsl:if>
      <!--	</xsl:otherwise>
    		</xsl:choose>
    -->
      <!-- MDS 2017-06-21 - The if and all to the named template are not needed.  
    			The apply-templates only runs with a page child exists. 
    			The named template (located in Rosetta_catchwordgrp_page.xsl) already only functions when page has a parent catchwordgrp or catchwords.
    		-->
      <xsl:apply-templates select="page[not($streamID='HK03')]"/>
      <!--<xsl:if test="child::page">
    			<xsl:call-template name="page"/>
    		</xsl:if>-->
      <!--<xsl:if test="page">
    	    <classify:classification>
    	      <classify:classitem>
    	        <classify:classitem-identifier>
    	          <classify:classname>
    	            <xsl:apply-templates select="page"/>	          
    	          </classify:classname>
    	        </classify:classitem-identifier>
    	      </classify:classitem>
    	    </classify:classification>
    	  </xsl:if>-->
    </xsl:template>
    Template catchwordgrp/heading
    Namespace No namespace
    Match catchwordgrp/heading
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="catchwordgrp/heading">
      <!--  Original Target XPath:  caseinfo:caseinfo/classify:classification/heading   -->
      <heading>
        <xsl:apply-templates select="@* | node()"/>
      </heading>
    </xsl:template>
    Template catchwords/text()[following::catchphrase or preceding::catchphrase]
    Documentation

    Description

    <xsl:template match="catchwordgrp/catchwords">
    
    		<!-\-  Original Target XPath:  caseinfo:caseinfo/classify:classification   -\->
    		<caseinfo:caseinfo>
    			<classify:classification>
    				<xsl:apply-templates select="@* | node()"/>
    			</classify:classification>
    		</caseinfo:caseinfo>
    
    	</xsl:template>
     If the punctuation marks occuring between catchwords and catchphrase conversion should drop these punctuation in output this will be
    handle by stylesheet. 
     Awntika-2017-11-15- Updated for webstar 7047020, where text is coming outside catchphrase and it should be taken inside
    					classify:classname and text should drop from the caseinfo:caseinfo 
    Namespace No namespace
    Match catchwords/text()[following::catchphrase or preceding::catchphrase]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="catchwords/text()[following::catchphrase or preceding::catchphrase]">
      <xsl:choose>
        <xsl:when test="$streamID='AU01'"/>
        <xsl:otherwise>
          <xsl:value-of select="replace(., '[^a-zA-Z0-9]', ' ')"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template catchwords/catchphrase
    Namespace No namespace
    Match catchwords/catchphrase
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="catchwords/catchphrase">
      <!--  Original Target XPath:  classify:classification/classify:classitem/classify:classitem-identifier/classify:classname   -->
      <!-- JD: 2017-06-15: I can find no instruction for creating @classscheme='catchphrase' in id-CCCC-12023 -->
      <classify:classitem>
        <!-- classscheme="catchphrase">-->
        <xsl:if test="$streamID=('AU13','UK02','HK09')">
          <xsl:attribute name="classscheme">catchphrase</xsl:attribute>
        </xsl:if>
        <classify:classitem-identifier>
          <classify:classname>
            <xsl:apply-templates select="@* | node()"/>
            <!-- Awantika: 2017-11-15- Updated for webstar 7047020, where text is coming outside catchphrase and it should be taken inside
    					classify:classname and text should drop from the caseinfo:caseinfo-->
            <xsl:if test="$streamID='AU01' and following-sibling::text()[1]">
              <xsl:value-of select="./following-sibling::text()[1]"/>
            </xsl:if>
          </classify:classname>
        </classify:classitem-identifier>
      </classify:classitem>
    </xsl:template>
    Template catchphrase
    Documentation

    Description

    	<xsl:template match="nl">
    
    		<!-\-  Original Target XPath:     -\->
    		<!-\-  Could not determine target element or attribute name:  <>  -\->			<xsl:apply-templates select="@* | node()"/>
    		<!-\-  Could not determine target element or attribute name:  </>  -\->
    
    	</xsl:template>
    Namespace No namespace
    Match catchphrase
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="catchphrase">
      <!--  Original Target XPath:     -->
      <!--  Could not determine target element or attribute name:  <>  -->
      <xsl:apply-templates select="@* | node()"/>
      <!--  Could not determine target element or attribute name:  </>  -->
    </xsl:template>
    Template page[parent::catchwordgrp or parent::catchwords]page
    Documentation

    Description

    catchwordgrp/page becomes classify:classification/classify:classitem/classify:classitem-identifier/classify:classname/ref:page.

    Source XML

    <catchwordgrp>
      <catchwords>
        <catchphrase>Emergency Legislation &#x2013; Trading with the enemy &#x2013; Guarantee by English
          company of debt due to neutral by German company &#x2013; Whether payment under guarantee for
          benefit or in discharge of obligation of enemy <ci:cite searchtype="LEG-REF" status="valid">
            <ci:sesslaw>
              <ci:sesslawinfo>
                <ci:sesslawnum num="1939_89a"/>
                <ci:hierpinpoint>
                  <ci:hierlev label="section" num="1"/>
                </ci:hierpinpoint>
              </ci:sesslawinfo>
              <ci:sesslawref>
                <ci:standardname normpubcode="UK_ACTS"/>
              </ci:sesslawref>
            </ci:sesslaw>
            <ci:content>Trading with the Enemy Act 1939 (c 89), s 1(2)(a) </ci:content>
          </ci:cite>. </catchphrase>
      </catchwords>
      <page text="[1941] 1 All ER 257 at " count="258" reporter="ALLER"/>
    </catchwordgrp>
          
    becomes
    <classify:classification classscheme="catchwords">
      <classify:classitem>
        <classify:classitem-identifier>
          <classify:classname> Emergency Legislation &#x2013; Trading with the enemy &#x2013; Guarantee
            by English company of debt due to neutral by German company &#x2013; Whether payment under
            guarantee for benefit or in discharge of obligation of enemy <lnci:cite status="valid">
              <lnci:sesslaw>
                <lnci:sesslawinfo>
                  <lnci:sesslawnum num="1939_89a"/>
                  <lnci:hierpinpoint>
                    <lnci:hierlev label="section" num="1"/>
                  </lnci:hierpinpoint>
                </lnci:sesslawinfo>
                <lnci:sesslawref>
                  <lnci:standardname normpubcode="UK_ACTS"/>
                </lnci:sesslawref>
              </lnci:sesslaw>
              <lnci:content>Trading with the Enemy Act 1939 (c 89), s 1(2)(a) </lnci:content>
            </lnci:cite>. </classify:classname>
        </classify:classitem-identifier>
      </classify:classitem>
    </classify:classification>
    <classify:classification classscheme="catchwords">
      <classify:classitem>
        <classify:classitem-identifier>
          <classify:classname>
            <ref:page num="258" page-scheme="ALLER" page-scheme-type="reporterabbreviation"/>
          </classify:classname>
        </classify:classitem-identifier>
      </classify:classitem>
    </classify:classification>
          

    Description

     Already Done 
     <topicref href="../../common_caselaw/Rosetta_catchwordgrp_page.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_catchwordgrp_page.dita  
    Namespace No namespace
    Match page[parent::catchwordgrp or parent::catchwords]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="page[parent::catchwordgrp or parent::catchwords]" name="page">
      <!--  Original Target XPath:  classify:classification/classify:classitem/classify:classitem-identifier/classify:classname/ref:page   -->
      <classify:classification>
        <classify:classitem>
          <classify:classitem-identifier>
            <classify:classname>
              <ref:page>
                <xsl:attribute name="num">
                  <xsl:value-of select="@count"/>
                </xsl:attribute>
                <!-- JD: 2017-07-12: added if test to prevent schema validation errors 
    	          		      "cvc-datatype-valid.1.2.1: '' is not a valid value for 'NMTOKEN'." 
    	          		   and 
    	          		   	  "cvc-attribute.3: The value '' of attribute 'page-scheme' on element 'ref:page' is not valid with respect to its type, 'NMTOKEN'." -->
                <xsl:if test="normalize-space(@reporter)!=''">
                  <xsl:attribute name="page-scheme">
                    <xsl:value-of select="@reporter"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:attribute name="page-scheme-type">
                  <xsl:text>reporter-abbreviation</xsl:text>
                </xsl:attribute>
              </ref:page>
            </classify:classname>
          </classify:classitem-identifier>
        </classify:classitem>
      </classify:classification>
    </xsl:template>
    Template case:factsummarysummaries
    Documentation

    Description

    The attributes of case:factsummary are handled as follows:

    • case:factsummary/@subdoc becomes casesum:editorialsummary/@includeintoc.
    • case:factsummary/@toc-caption becomes casesum:editorialsummary/@alternatetoccaption.

    Note: Conversion should not create consecutive casesum:summaries elements. When 2 or more consecutive sibling source elements map to casesum:summaries, target data should be merged to a single casesum:summaries element unless this would hamper content ordering.

    Note: Andrew: Editorially added content.

    <case:factsummary>
      <p>
        <text>The respondents (the agents) were engaged by Combined as insurance agents. The respondents commenced proceedings in the Chief Industrial Magistrates Court of NSW (Industrial Court) claiming entitlements to annual and long service leave. That court&#x2019;s jurisdiction to make orders was conferred by the Workplace Relations Act 1996 (Cth). Combined commenced proceedings in the Federal Court seeking declarations that the respondents were independent contractors. It also sought an indemnity from each agent for misrepresenting that each was an independent contractor if they were not; and damages. On 27 April 2009, the agents filed a notice of motion seeking that the proceedings against them be dismissed primarily on the basis none of the claims was in federal jurisdiction.
        </text>
      </p>
    </case:factsummary>
               
    becomes
    <casesum:summaries>
      <casesum:editorialsummary>
        <p>
          <text>The respondents (the agents) were engaged by Combined as insurance agents. The respondents commenced proceedings in the Chief Industrial Magistrates Court of NSW (Industrial Court) claiming entitlements to annual and long service leave. That court&#x2019;s jurisdiction to make orders was conferred by the Workplace Relations Act 1996 (Cth). Combined commenced proceedings in the Federal Court seeking declarations that the respondents were independent contractors. It also sought an indemnity from each agent for misrepresenting that each was an independent contractor if they were not; and damages. On 27 April 2009, the agents filed a notice of motion seeking that the proceedings against them be dismissed primarily on the basis none of the claims was in federal jurisdiction.
          </text>
        </p>
      </casesum:editorialsummary>
    </casesum:summaries>
               
    <case:factsummary>
      <l>
        <li>
          <lilabel><emph typestyle="ro">&hellip;</emph></lilabel>
          <p>
            <text></text>
          </p>
        </li>
        <li>
          <lilabel><emph typestyle="ro">(d)</emph></lilabel>
          <p>
            <text>in the opinion of the Commission, the death of the veteran was due to an accident that would not have occurred, or to a disease that would not have been contracted, but for his or her having rendered eligible war service or but for changes in the veteran's environment consequent upon his or her having rendered eligible war service &hellip;&rdquo;</text>
          </p>
        </li>
      </l>
      <p><text>Counsel for W relied upon dictionary definitions of &ldquo;consequent upon&rdquo; to mean &ldquo;following as a result&rdquo; and &ldquo;following logically&rdquo;.</text>
      </p>
    </case:factsummary>
               
    becomes
    <casesum:summaries>
      <casesum:editorialsummary>
        <p>
          <list>
          <listitem>
            <label><emph typestyle="ro">&#x2026;</emph></label>
            <p>
              <text></text>
            </p>
          </listitem>
          <listitem>
            <label><emph typestyle="ro">(d)</emph></label>
            <p>
              <text>in the opinion of the Commission, the death of the veteran was due to an accident that would not have occurred, or to a disease that would not have been contracted, but for his or her having rendered eligible war service or but for changes in the veteran's environment consequent upon his or her having rendered eligible war service &#x2026;&#x201D;</text>
            </p>
          </listitem>
          </list>
        </p>
        <p>
          <text>Counsel for W relied upon dictionary definitions of &#x201C;consequent upon&#x201D; to mean &#x201C;following as a result&#x201D; and &#x201C;following logically&#x201D;.</text>
        </p>
      </casesum:editorialsummary>
    </casesum:summaries>
               

    Description

     end topicref  ../../common_caselaw/Rosetta_catchwordgrp.dita  
     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.factsummary-LxAdv_casesum.editorialsummary.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.factsummary-LxAdv_casesum.editorialsummary.dita  
    Namespace No namespace
    Match case:factsummary
    Mode summaries
    Import precedence 0
    Source
    <xsl:template match="case:factsummary" mode="summaries">
      <!--  Original Target XPath:  casesum:editorialsummary/@includeintoc   -->
      <casesum:editorialsummary>
        <xsl:if test="@subdoc">
          <xsl:attribute name="includeintoc">
            <xsl:value-of select="@subdoc"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="@toc-caption">
          <xsl:attribute name="alternatetoccaption">
            <xsl:value-of select="@toc-caption"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:apply-templates select="@* | node()"/>
      </casesum:editorialsummary>
    </xsl:template>
    Template case:decisionsummarysummaries
    Documentation

    Description

    The optional attributes of case:decisionsummary are handled as follows:

    • case:decisionsummary/@summarytype becomes casesum:decisionsummary/@summarysource
    • case:decisionsummary/@subdoc becomes casesum:decisionsummary/@includeintoc
    • case:decisionsummary/@toc-caption becomes casesum:decisionsummary/@alternatetoccaption

    <case:decisionsummary summarytype="held">
      <p>
        <text>
          <emph typestyle="bf">Held</emph>, dismissing the motion:
        </text>
      </p>
      <p>
        <text>(i)&#x2003;The proceedings before the Industrial Court were wholly in federal jurisdiction. The claim by Combined against each agent in the Federal Court and the claim by each agent against Combined in the Industrial Court arose largely out of the same substratum of fact. It followed there was, as between each agent and Combined, a single matter comprising the basic question of whether each agent was an employee, related questions of estoppel and misleading conduct and remedial issues relating to money and penalties: at [13], [16].
        </text>
      </p>
    </case:decisionsummary>
           
    becomes
    <casesum:summaries>
      <casesum:decisionsummary summarysource="held">
        <bodytext>
          <p>
            <text><emph typestyle="bf">Held</emph>, dismissing the motion:</text>
          </p>
          <p>
            <text>(i)&#x2003;The proceedings before the Industrial Court were wholly in federal jurisdiction. The claim by Combined against each agent in the Federal Court and the claim by each agent against Combined in the Industrial Court arose largely out of the same substratum of fact. It followed there was, as between each agent and Combined, a single matter comprising the basic question of whether each agent was an employee, related questions of estoppel and misleading conduct and remedial issues relating to money and penalties: at [13], [16].
            </text>
          </p>
        </bodytext>
      </casesum:decisionsummary>
    </casesum:summaries>
           

    Description

    <xsl:template match="case:factsummary">
    		<!-\-  Original Target XPath:  casesum:editorialsummary/@includeintoc   -\->
    		<casesum:editorialsummary>
    			<xsl:apply-templates select="node() | @*"/>
    		</casesum:editorialsummary>
    	</xsl:template>
    	
    	<xsl:template match="l[parent::case:factsummary]">
    		<p>
    			<list>
    				<xsl:apply-templates/>
    			</list>
    		</p>
    	</xsl:template>
    
    	<xsl:template match="case:factsummary/@subdoc">
    		<!-\-  Original Target XPath:  casesum:editorialsummary/@includeintoc   -\->
    		<xsl:attribute name="includeintoc">
    			<xsl:value-of select="."/>
    		</xsl:attribute>
    	</xsl:template>
    
    	<xsl:template match="case:factsummary/@toc-caption">
    		<xsl:attribute name="alternatetoccaption">
    			<xsl:value-of select="."/>
    		</xsl:attribute>
    	</xsl:template>
     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.decisionsummary-LxAdv_casesum.decisionsummary.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.decisionsummary-LxAdv_casesum.decisionsummary.dita  
    <xsl:template match="case:decisionsummary">
    		<!-\-  Original Target XPath:  casesum:decisionsummary/@summarysource   -\->
    		<casesum:decisionsummary>
    				<xsl:apply-templates select="@*"/>
    			<xsl:if test="heading">
    				<xsl:apply-templates select="heading"/>
    			</xsl:if>
    			<xsl:if test="node() except (heading,blockquote[child::case:embeddedcase])">
    				<bodytext>
    					<xsl:apply-templates select="node() except heading"/>
    				</bodytext>
    			</xsl:if>
    			<xsl:if test="blockquote[child::case:embeddedcase]">
    				<xsl:apply-templates select="./blockquote/case:embeddedcase"/>
    			</xsl:if>
    		</casesum:decisionsummary>
    	</xsl:template>
    
    	<xsl:template match="case:decisionsummary/@summarytype">
    		<!-\-  Original Target XPath:  casesum:decisionsummary/@summarysource   -\->
    			<xsl:attribute name="summarysource">
    				<xsl:value-of select="."/>
    			</xsl:attribute>
    	</xsl:template>
    
    	<xsl:template match="case:decisionsummary/@subdoc">
    		<!-\-  Original Target XPath:  casesum:decisionsummary/@includeintoc   -\->
    			<xsl:attribute name="includeintoc">
    				<xsl:value-of select="."/>
    			</xsl:attribute>
    	</xsl:template>
    
    	<xsl:template match="case:decisionsummary/@toc-caption">
    		<!-\-  Original Target XPath:  casesum:decisionsummary/@alternatetoccaption   -\->
    			<xsl:attribute name="alternatetoccaption">
    				<xsl:value-of select="."/>
    			</xsl:attribute>
    	</xsl:template>
    Namespace No namespace
    Match case:decisionsummary
    Mode summaries
    Import precedence 0
    Source
    <xsl:template match="case:decisionsummary" mode="summaries">
      <!--  Original Target XPath:  casesum:decisionsummary/@summarysource   -->
      <casesum:decisionsummary>
        <xsl:if test="@summarytype">
          <xsl:attribute name="summarysource">
            <xsl:value-of select="@summarytype"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="@subdoc">
          <xsl:attribute name="includeintoc">
            <xsl:value-of select="@subdoc"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="@toc-caption">
          <xsl:attribute name="alternatetoccaption">
            <xsl:value-of select="@toc-caption"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:apply-templates select="heading"/>
        <bodytext>
          <xsl:apply-templates select="@* | node() except heading"/>
        </bodytext>
        <xsl:apply-templates select="//case:headnote/page"/>
      </casesum:decisionsummary>
    </xsl:template>
    Template case:decisionsummary/@summarytype
    Namespace No namespace
    Match case:decisionsummary/@summarytype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:decisionsummary/@summarytype"/>
    Template case:consideredcases
    Documentation

    Description

    <case:consideredcases>
      <p>
        <text>
          <ci:cite searchtype="CASE-REF">
            <ci:case>
              <ci:caseinfo>
                <ci:decisiondate year="1995"/>
              </ci:caseinfo>
              <ci:caseref ID="cr000001" spanref="cr000001-001" status="unval">
                <ci:reporter value="clr"/>
                <ci:volume num="183"/>
                <ci:page num="501"/>
              </ci:caseref>
              <ci:caseref ID="cr000002" spanref="cr000002-002">
                <ci:reporter value="alr"/>
                <ci:volume num="130"/>
                <ci:page num="529"/>
              </ci:caseref>
              <ci:caseref ID="cr000003" spanref="cr000003-003">
                <ci:reporter value="acsr"/>
                <ci:volume num="17"/>
                <ci:page num="551"/>
              </ci:caseref>
              <ci:caseref ID="cr000004" spanref="cr000004-004">
                <ci:reporter value="urj"/>
                <ci:refnum num="BC9506451"/>
              </ci:caseref>
            </ci:case>
            <ci:content>
              <citefragment searchtype="CASE-NAME-REF">
                <emph typestyle="it">R v Byrnes &amp; Hopwood</emph>
              </citefragment>
              <citefragment searchtype="CASE-CITE-REF"> 
                <ci:span spanid="cr000001-001" status="unval">(1995) 183 CLR 501</ci:span> ; 
                <ci:span spanid="cr000002-002">130 ALR 529</ci:span> ; 
                <ci:span spanid="cr000003-003">17 ACSR 551</ci:span> ; 
                <ci:span spanid="cr000004-004"> [1995] HCA 1</ci:span>
              </citefragment>
            </ci:content>
          </ci:cite>
          , followed
        </text>
      </p>
    </case:consideredcases>
               
    becomes
    <ref:relatedrefs referenctype="consideredcases">
      <bodytext>
        <p>
          <text>
            <lnci:cite>
              <lnci:case>
                <lnci:caseinfo>
                  <lnci:decisiondate year="1995"/>
                </lnci:caseinfo>
                <lnci:caseref ID="cr000001" status="unval">
                  <lnci:reporter value="clr"/>
                  <lnci:volume num="183"/>
                  <lnci:page num="501"/>
                </lnci:caseref>
                <lnci:caseref ID="cr000002">
                  <lnci:reporter value="alr"/>
                  <lnci:volume num="130"/>
                  <lnci:page num="529"/>
                </lnci:caseref>
                <lnci:caseref ID="cr000003">
                  <lnci:reporter value="acsr"/>
                  <lnci:volume num="17"/>
                  <lnci:page num="551"/>
                </lnci:caseref>
                <lnci:caseref ID="cr000004">
                  <lnci:reporter value="urj"/>
                  <lnci:refnum num="BC9506451"/>
                </lnci:caseref>
              </lnci:case>
              <ci:content>
                <emph typestyle="it">R v Byrnes &amp; Hopwood</emph> (1995) 183 CLR 501; 130 ALR 529; 17 ACSR 551; [1995] HCA 1
              </ci:content>
            </lnci:cite>
            , followed
          </text>
        </p>
      </bodytext>
    </ref:relatedrefs>
               

    Description

     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.consideredcases-LxAdv_ref.relatedrefs.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.consideredcases-LxAdv_ref.relatedrefs.dita  
    Namespace No namespace
    Match case:consideredcases
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:consideredcases">
      <ref:relatedrefs>
        <xsl:attribute name="referencetype">
          <xsl:text>consideredcases</xsl:text>
        </xsl:attribute>
        <xsl:if test="child::heading">
          <xsl:apply-templates select="heading"/>
        </xsl:if>
        <xsl:if test="node() except heading">
          <bodytext>
            <xsl:apply-templates select="@* | node() except heading"/>
          </bodytext>
        </xsl:if>
        <!--<xsl:apply-templates select="@* | node()"/>-->
      </ref:relatedrefs>
    </xsl:template>
    Template case:embeddedcase
    Documentation

    Description

    • case:embeddedcase becomes courtcase:caseexcerpt and attribute @id becomes @xml:id.

      Note: courtcase:caseexcerpt/@xml:id that begins with a number must have an underscore added at start.

      Note: If case:embeddedcase occurs as a child element of blockquote then conversion need to omit tag (blockquote) and retain content.

      
      <case:decisionsummary>
        <blockquote>
            <case:embeddedcase id="1980_QD_R_411">
                  <case:content>
                      <case:judgments>
                          <case:judgment subdoc="true" toc-caption="Judgment 1">
                              <case:judgmentbody>
                                  <p>
                                      <text>This was an action...</text>
                                  </p>
                              </case:judgmentbody>
                          </case:judgment>
                      </case:judgments>
                  </case:content>
            </case:embeddedcase>
        </blockquote>
      </case:decisionsummary>
      
      Becomes
      
      <casesum:decisionsummary>
                  <courtcase:caseexcerpt xml:id="_1980_QD_R_411">
                      <courtcase:body>
                          <courtcase:opinions>
                              <courtcase:opinion includeintoc="true" alternatetoccaption="Judgment 1">
                                  <bodytext>
                                      <p>
                                          <text>This was an action...</text>
                                      </p>
                                  </bodytext>
                              </courtcase:opinion>
                          </courtcase:opinions>
                      </courtcase:body>    
                  </courtcase:caseexcerpt>
      </casesum:decisionsummary>
      
      

    Description

     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.embeddedcase-LxAdv_courtcase.caseexcerpt.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.embeddedcase-LxAdv_courtcase.caseexcerpt.dita  
    Namespace No namespace
    Match case:embeddedcase
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:embeddedcase">
      <!--  Original Target XPath:  courtcase:caseexcerpt   -->
      <courtcase:caseexcerpt>
        <xsl:choose>
          <xsl:when test="case:body/case:headnote/case:factsummary | case:body/case:headnote/case:decisionsummary | case:body/case:headnote/case:references | case:body/case:headnote/case:info">
            <courtcase:head>
              <xsl:apply-templates select="case:body/case:headnote/case:info"/>
              <casesum:summaries>
                <xsl:apply-templates select="case:body/case:headnote/case:factsummary" mode="summaries"/>
                <xsl:apply-templates select="case:body/case:headnote/case:decisionsummary" mode="summaries"/>
                <xsl:apply-templates select="case:disposition[parent::case:headnote]" mode="summaries"/>
                <!--<xsl:apply-templates select="case:body/case:content/case:typeofcase" mode="summaries-->
              </casesum:summaries>
              <xsl:apply-templates select="case:body/case:headnote/case:references"/>
            </courtcase:head>
          </xsl:when>
          <xsl:otherwise>
            <courtcase:body>
              <xsl:apply-templates select="case:content/case:typeofcase"/>
              <xsl:apply-templates select="case:embeddedcase"/>
              <xsl:apply-templates select="case:content/case:judgments"/>
              <!--<xsl:apply-templates select="case:content/case:judgments/case:judgment/case:courtinfo/case:judges[ancestor::case:content]"/>-->
              <!--<xsl:apply-templates select="case:content/case:judgments/case:constituents"/>-->
              <!--<xsl:apply-templates select="case:content/case:judgments/case:disposition"/>-->
              <!--<xsl:apply-templates select="case:content/case:judgments/case:appendix"/>-->
              <xsl:apply-templates select="case:courtinfo"/>
              <xsl:apply-templates select="case:content/case:author"/>
              <xsl:apply-templates select="case:content/case:appendix[not(parent::case:judgments)]"/>
              <xsl:apply-templates select="case:content/page"/>
              <xsl:choose>
                <xsl:when test="heading">
                  <xsl:apply-templates select="@* | node() except heading"/>
                </xsl:when>
              </xsl:choose>
              <!--			<xsl:apply-templates select="case:content/case:author"/>-->
              <!--<xsl:apply-templates select="case:content/case:judgments"/>
    			<xsl:apply-templates select="case:content/page"/>
    			<xsl:apply-templates select="case:content/case:typeofcase"/>
    			<xsl:apply-templates select="case:content/case:appendix[not(parent::case:judgments)]"/>
    			
    			<xsl:apply-templates select="case:content/case:judgments/case:constituents"/>
    			<xsl:apply-templates select="case:content/case:author"/>
    			<xsl:apply-templates select="@* | node() except case:info[parent::case:headnote]"/>-->
            </courtcase:body>
          </xsl:otherwise>
        </xsl:choose>
      </courtcase:caseexcerpt>
    </xsl:template>
    Template case:references
    Documentation

    Description

    case:references becomes courtcase:head/ref:relatedrefs.

    With the exception of heading, all children of case:references should be mapped to children of ref:relatedrefs/bodytext.

    Canada streams only:

    Please refer the below table for the following scenario: If initial contents of case:references equals first column of table then (either within heading/title, text/emph typestyle="bf", etc), add an attribute @referencetype and set the value @referencetype= second column of table. See CA Example 2 & 3.

  • Unique Values for search
  • Replace attribute Value
  • Articles cited:
  • consideredcases
  • Authorities Cited:
  • consideredcases
  • Authorities cited:
  • consideredcases
  • Authorities Considered:
  • consideredcases
  • Authors and Works cited:
  • consideredcases
  • AUTHORS AND WORKS JUDICIALLY NOTICED:
  • consideredcases
  • AUTHORS AND WORKS NOTICED:
  • consideredcases
  • Authors and Works Noticed:
  • consideredcases
  • Authors Cited
  • consideredcases
  • Authors cited
  • consideredcases
  • Autorité citée :
  • consideredcases
  • Autorités :
  • consideredcases
  • Autorités citées :
  • consideredcases
  • CASE CITED:
  • consideredcases
  • Cases Cited
  • consideredcases
  • CASES CITED:
  • consideredcases
  • Cases Cited:
  • consideredcases
  • Cases cited:
  • consideredcases
  • Cases Considered:
  • consideredcases
  • CASES JUDICIALLY CONSIDERED
  • consideredcases
  • Cases Judicially Considered
  • consideredcases
  • CASES JUDICIALLY NOTICED:
  • consideredcases
  • CASES NOTICED:
  • consideredcases
  • Cases Noticed:
  • consideredcases
  • Décision citée :
  • consideredcases
  • Décisions citées :
  • consideredcases
  • DOCTRINE
  • consideredcases
  • Doctrine
  • consideredcases
  • Doctrine citée
  • consideredcases
  • JURISPRUDENCE
  • consideredcases
  • Jurisprudence
  • consideredcases
  • Jurisprudence citée
  • consideredcases
  • Jurisprudence citée :
  • consideredcases
  • Jurisprudence consultée :
  • consideredcases
  • Législation citée :
  • legislation
  • Lois et règlements
  • legislation
  • Lois et règlements cités
  • legislation
  • MISCELLANEOUS WORKS CITED:
  • consideredcases
  • Statutes and Regulations Cited
  • legislation
  • STATUTES AND REGULATIONS CITED:
  • legislation
  • Statutes and Regulations cited:
  • legislation
  • Statutes and Regulations Judicially Considered
  • legislation
  • Statutes Cited:
  • legislation
  • Statutes cited:
  • legislation
  • STATUTES JUDICIALLY NOTICED:
  • legislation
  • STATUTES NOTICED:
  • legislation
  • Statutes Noticed:
  • legislation
  • Statutes, Regulations and Rule Cited:
  • legislation
  • Statutes, Regulations and Rules cited
  • legislation
  • STATUTES, REGULATIONS AND RULES CITED:
  • legislation
  • Statutes, Regulations and Rules Cited:
  • legislation
  • Authorities Cited
  • consideredcases
  • Authors Cited
  • consideredcases
  • Cases and texts cited
  • consideredcases
  • CASES CITED
  • consideredcases
  • Cases Cited
  • consideredcases
  • Cases cited
  • consideredcases
  • Doctrine citée
  • consideredcases
  • Jurisprudence
  • consideredcases
  • Législation citée
  • legislation
  • Lois et règlements cités
  • legislation
  • MISCELLANEOUS WORKS CITED
  • consideredcases
  • Statutes and Regulations Cited
  • legislation
  • Statutes cited
  • legislation
  • STATUTES, REGULATIONS AND RULES CITED
  • legislation
  • Statutes, Regulations and Rules Cited
  • legislation
  • Statutes, Regulations and Rules cited
  • legislation
  • Législation citée:
  • legislation
  • JURISPRUDENCE CITÉE :
  • consideredcases
  • Affaire citée:
  • consideredcases
  • Affaires citées:
  • consideredcases
  • Affaires citées:
  • consideredcases
  • Authorities & Texts:
  • consideredcases
  • Authorities
  • consideredcases
  • Autorités citées *
  • consideredcases
  • Autorités citées par l'appelante :
  • consideredcases
  • Autorités citées par l'intimé :
  • consideredcases
  • Autorités citées
  • consideredcases
  • Case Authorities and Texts:
  • consideredcases
  • Cases considered:
  • consideredcases
  • Cases referred to:
  • consideredcases
  • Dictionnaire cité :
  • consideredcases
  • Jurisprudence :
  • consideredcases
  • Jurisprudence :
  • consideredcases
  • JURISPRUDENCE DÉPOSÉE PAR L'INTIMÉE
  • consideredcases
  • Jurisprudence soumise
  • consideredcases
  • Jurisprudence:
  • consideredcases
  • Législation citée:
  • legislation
  • Liste de jurisprudence
  • legislation
  • Liste des jugements à l'appui:
  • consideredcases
  • LISTE DES JUGEMENTS À L'APPUI
  • consideredcases
  • Loi citée:
  • legislation
  • Lois citées:
  • legislation
  • Lois et règlements cités :
  • legislation
  • Par l'intimé :
  • consideredcases
  • Statutes considered:
  • legislation
  • Statutes Referred to:
  • legislation
  • Statutes referred to:
  • legislation
  • Tribunal decisions considered:
  • consideredcases
  • STATUTE AND REGULATION CITED
  • legislation
  • STATUTES AND REGULATION CITED
  • legislation
  • STATUTES AND REGULATION CITED:
  • legislation
  • REGULATION CITED
  • legislation
  • STATUTE CITED
  • legislation
  • Rules and Regulations considered
  • legislation
  • Lois, règlements et règles cités:
  • legislation
  • STATUTES, RULES AND REGULATIONS CITED
  • legislation
  • Rules cited
  • legislation
  • Regulations Cited
  • legislation
  • Lois et règlement cités
  • legislation
  • LOI ET RÈGLEMENT CITÉS
  • legislation
  • RÈGLEMENT CITÉ
  • legislation
  • STATUTES, RULES AND REGULATIONS CITED
  • legislation
  • Autorités consultées:
  • consideredcases
  • AUTORITÉS CONSULTÉES
  • consideredcases
  • Autorités citées par la requérante:
  • consideredcases
  • Autres autorités consultées
  • consideredcases
  • Case Authorities Referred to
  • consideredcases
  • Liste des autorités citées
  • consideredcases
  • JURISPRUDENCE CITÉE
  • consideredcases
  • Doctrine et jurisprudence :
  • consideredcases
  • Cases referred to
  • consideredcases
  • LEGISLATION:
  • legislation
  • Doctrine et jurisprudence
  • consideredcases
  • Note:

    Remove the colon (:) or space colon ( :) which comes under ref:relatedrefs under heading/title.

    • Avocats: to Avocats
    • Avocats : to Avocats
    • Cases cited: to Cases cited
    • Cases Cited: to Cases Cited
    • Jurisprudence cite : to Jurisprudence cite
    • Statutes, Regulations and Rules Cited: to Statutes, Regulations and Rules Cited
    • Législation citée : to Législation citée
    • Authors and Texts Cited: to Authors and Texts Cited
    • Texts Cited: to Texts Cited
    • Causes citées et consultées : to Causes citées et consultées
    • Jurisprudence et doctrine citées et consultées : to Jurisprudence et doctrine citées et consultées
    • Doctrine et jurisprudence citées : to Doctrine et jurisprudence citées
    • Doctrine citée : to Doctrine citée
    • Counsel: to Counsel

    Example: AU content

    <case:references>
      <p>
        <text>
          <ci:cite searchtype="LEG-REF">
            <ci:content>(CTH) 
              <citefragment searchtype="LEG-NAME-REF">Criminal Code (Q)</citefragment>
              <citefragment searchtype="CI-LEG-LAWNUM">minal Code (Q), s 31(1)(d)</citefragment>
            </ci:content>
          </ci:cite>
        </text>
      </p>
    </case:references>
               
    becomes
    <ref:relatedrefs>
      <bodytext>
        <p>
          <text>
            <lnci:cite type="legislation">
              <lnci:content>(CTH) Criminal Code (Q) minal Code (Q), s 31(1)(d)</lnci:content>
            </lnci:cite>
          </text>
        </p>
      </bodytext>   
    </ref:relatedrefs>
               

    Example: NZ content

    <case:references>
      <heading><title>Cases mentioned in judgment</title></heading>
      <p>
        <text>
          <ci:cite searchtype="CASE-REF">
            <ci:case>
              <ci:caseref ID="x20110NZCCLR_1-1" spanref="x20110NZCCLR_1-1-1">
                <ci:reporter value="nzclc" country="nz"/>
                <ci:volume num="3"></ci:volume>
                <ci:edition>
                  <ci:date year="1986"/>
                </ci:edition>
                <ci:page num="100,054"/>
              </ci:caseref>
            </ci:case>
            <ci:content>
              <citefragment searchtype="CASE-NAME-REF">
                <emph typestyle="it">Cotterall v Fidelity Life Assurance Co Ltd</emph>
              </citefragment> 
              <citefragment searchtype="CASE-CITE-REF">
                <ci:span spanid="x20110NZCCLR_1-1-1">(1986) 3 NZCLC 100,054 (HC)</ci:span>
              </citefragment>.
            </ci:content>
          </ci:cite>
        </text>
      </p>
    </case:references>
               
    becomes
    <ref:relatedrefs>
      <heading><title>Cases mentioned in judgment</title></heading>
      <bodytext>
        <p>
          <text>
            <lnci:cite>
              <lnci:case>
                <lnci:caseref ID="x20110NZCCLR_1-1">
                  <lnci:reporter value="nzclc" country="nz"/>
                  <lnci:volume num="3"></ci:volume>
                  <lnci:edition>
                    <lnci:date year="1986"/>
                  </lnci:edition>
                  <lnci:page num="100,054"/>
                </lnci:caseref>
              </lnci:case>
              <lnci:content>
                <emph typestyle="it">Cotterall v Fidelity Life Assurance Co Ltd</emph> (1986) 3 NZCLC 100,054 (HC)
              </lnci:content>
            </lnci:cite>
          </text>
        </p>
      </bodytext>   
    </ref:relatedrefs>
               

    Example: CA content

    <case:references>
        <heading>
            <title>Cases Cited:</title>
        </heading>
        <p>
            <text>Soo Mill and Lumber Co. Ltd. v. City of Sault Ste-Marie <ci:cite searchtype="SUMM-CASE-REF">
                    <ci:case>
                        <ci:caseref ID="cref00003130" spanref="cspan00003130">
                            <ci:reporter value="NR"/>
                            <ci:volume num="2"/>
                            <ci:page num="492"/>
                        </ci:caseref>
                    </ci:case>
                    <ci:content><ci:span spanid="cspan00003130">2 N.R. 492</ci:span></ci:content>
                </ci:cite>; City of Montreal v. Morgan <ci:cite searchtype="SUMM-CASE-REF">
                    <ci:case>
                        <ci:caseinfo>
                            <ci:decisiondate year="1920"/>
                        </ci:caseinfo>
                        <ci:caseref ID="cref00003131" spanref="cspan00003131">
                            <ci:reporter value="DLR"/>
                            <ci:volume num="54"/>
                            <ci:page num="165"/>
                        </ci:caseref>
                    </ci:case>
                    <ci:content><ci:span spanid="cspan00003131">(1920), 54 D.L.R. 165</ci:span></ci:content>
                </ci:cite>.</text>
        </p>
    </case:references>
               
    becomes
    <courtcase:head>
        ...
        <ref:relatedrefs referencetype="consideredcases">
            <heading>
                <title>Cases Cited</title>
            </heading>
            <bodytext>
                <p>
                    <text>Soo Mill and Lumber Co. Ltd. v. City of Sault Ste-Marie <lnci:cite>
                            <lnci:case>
                                <lnci:caseref ID="cref00003130">
                                    <lnci:reporter value="NR"/>
                                    <lnci:volume num="2"/>
                                    <lnci:page num="492"/>
                                </lnci:caseref>
                            </lnci:case>
                            <lnci:content>2 N.R. 492</lnci:content>
                        </lnci:cite>; City of Montreal v. Morgan <lnci:cite>
                            <lnci:case>
                                <lnci:caseinfo>
                                    <lnci:decisiondate year="1920"/>
                                </lnci:caseinfo>
                                <lnci:caseref ID="cref00003131">
                                    <lnci:reporter value="DLR"/>
                                    <lnci:volume num="54"/>
                                    <lnci:page num="165"/>
                                </lnci:caseref>
                            </lnci:case>
                            <lnci:content>(1920), 54 D.L.R. 165</lnci:content>
                        </lnci:cite>.</text>
                </p>
            </bodytext>
        </ref:relatedrefs>
        ...
    </courtcase:head>
               

    CA Example 2 - @referencetype="consideredcases"

    <case:references>
        <heading>
            <title>Cases Judicially Considered</title>
        </heading>
        <p>
    		...
        </p>
    </case:references>
               
    becomes
    <courtcase:head>
        ...
        <ref:relatedrefs referencetype="consideredcases">
            <heading>
                <title>Cases Judicially Considered</title>
            </heading>
            <bodytext>
                <p>
    				...
                </p>
            </bodytext>
        </ref:relatedrefs>
        ...
    </courtcase:head>
               

    CA Example 3 - @referencetype="legislation"

    <case:references>
    	<p>
    		<text>
    			<emph typestyle="bf">Statutes and Regulations Judicially Considered</emph>
    		</text>
    	</p>
        <p>
    		...
        </p>
    </case:references>
               
    becomes
    <courtcase:head>
        ...
        <ref:relatedrefs referencetype="legislation">
            <bodytext>
                <p>
    				<text>
    					<emph typestyle="bf">Statutes and Regulations Judicially Considered</emph>
    				</text>
                </p>
    				...
            </bodytext>
        </ref:relatedrefs>
        ...
    </courtcase:head>
               

    Example: UK content

    <case:references referencetype="cases">
        <h>
            <emph typestyle="bf">Cases referred to</emph>
        </h>
        <pgrp>
            <p>
                <text><emph typestyle="it">Guaranty Trust Co of New York v Hannay &amp; Co</emph>
                    <ci:cite searchtype="CASE-REF">
                        <ci:case>
                            <ci:caseref>
                                <ci:reporter value="KB"/>
                                <ci:volume num="2"/>
                                <ci:edition>
                                    <ci:date year="1915"/>
                                </ci:edition>
                                <ci:page num="536"/>
                            </ci:caseref>
                        </ci:case>
                        <ci:content>[1915] 2 KB 536</ci:content>
                    </ci:cite>; 30 Digest 147, <emph typestyle="it">219</emph>.
                </text>
            </p>
        </pgrp>
    </case:references>
               
    becomes
    
    <ref:relatedrefs referencetype="cases">
        <bodytext>
            <h>
                <emph typestyle="bf">Cases referred to</emph>
            </h>
            <pgrp>
                <p>
                    <text><emph typestyle="it">Guaranty Trust Co of New York v Hannay &#x0026; Co</emph>
                        <lnci:cite>
                            <lnci:case>
                                <lnci:caseref>
                                    <lnci:reporter value="KB"/>
                                    <lnci:volume num="2"/>
                                    <lnci:edition>
                                        <lnci:date year="1915"/>
                                    </lnci:edition>
                                    <lnci:page num="536"/>
                                </lnci:caseref>
                            </lnci:case>
                            <lnci:content>[1915] 2 KB 536</lnci:content>
                        </lnci:cite>; 30 Digest 147, <emph typestyle="it">219</emph>.
                    </text>
                </p>
            </pgrp>
        </bodytext>
    </ref:relatedrefs>
               

    Description

      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.references-LxAdv_ref.relatedrefs.dita  
    <xsl:param name="references" select="document('../../modules/nonamespace/references.xml')"/>
    	<xsl:template match="case:references">
    	 
    	  <xsl:variable name="case-data" select="normalize-space(.)"/>	
    	  <xsl:choose> 
    	    <!-\- Awantika: Please add stream ID as per the requirement -\->
    	    <xsl:when test="$streamID=('CA01','CA02','CA04','CA05')">
    	      <xsl:choose>
    	        <xsl:when test="count($references//reference[starts-with($case-data,./@key)[1]])>0">
    	          <ref:relatedrefs>		
    	            <xsl:attribute name="referencetype">
    	              <xsl:value-of select="($references//reference[starts-with($case-data,./@key)[1]]/@value)[1]"/>
    	            </xsl:attribute>
    	            <xsl:choose>
    	              <xsl:when test="descendant::heading">
    	                <xsl:apply-templates select="heading"/>
    	                <bodytext>
    	                  <xsl:apply-templates select="@* | node() except heading"/>
    	                </bodytext>
    	              </xsl:when>
    	              <xsl:otherwise>
    	                <xsl:apply-templates select="node()"/>
    	              </xsl:otherwise>
    	            </xsl:choose>	          
    	          </ref:relatedrefs>
    	        </xsl:when>
    	        <xsl:otherwise>
    	          <ref:relatedrefs>		
    	            <xsl:choose>
    	              <xsl:when test="descendant::heading">
    	                <xsl:apply-templates select="heading"/>
    	                <bodytext>
    	                  <xsl:apply-templates select="@* | node() except heading"/>
    	                </bodytext>
    	              </xsl:when>
    	              <xsl:otherwise>
    	                <xsl:apply-templates select="@* | node()"/>
    	              </xsl:otherwise>
    	            </xsl:choose>
    	          </ref:relatedrefs>
    	        </xsl:otherwise>
    	      </xsl:choose>
    	    </xsl:when>
    	    <xsl:otherwise>
    	      <ref:relatedrefs>		
    	        <xsl:choose>
    	          <xsl:when test="descendant::heading">
    	            <xsl:apply-templates select="heading"/>
    	            <bodytext>
    	              <xsl:apply-templates select="@* | node() except heading"/>
    	            </bodytext>
    	          </xsl:when>
    	          <xsl:otherwise>
    	            <xsl:apply-templates select="@* | node()"/>
    	          </xsl:otherwise>
    	        </xsl:choose>
    	      </ref:relatedrefs>
    	    </xsl:otherwise>
    	  </xsl:choose>
    	
    	</xsl:template>
     Vikas Rohilla : bodytext is the Mandatory Element so it is moved out to the if condition 
    Namespace No namespace
    Match case:references
    Mode #default
    References
    Variables
    Import precedence 0
    Source
    <xsl:template match="case:references">
      <xsl:variable name="case-data" select="normalize-space(.)"/>
      <xsl:choose>
        <!--SP LBU needs this via conversation with product lawyers-->
        <xsl:when test="$streamID=('CA19')">
          <xsl:choose>
            <xsl:when test="count($references//reference[starts-with($case-data,./@key)[1]])>0">
              <courtfiling:citedauthorities>
                <!-- Awantika: Updated if heading is coming -->
                <xsl:apply-templates select="heading"/>
                <bodytext>
                  <!--SP: For CA19, there is currently no need to process the referencetype attribute on case:references-->
                  <xsl:apply-templates select=" node() except (heading | @referencetype)"/>
                </bodytext>
              </courtfiling:citedauthorities>
            </xsl:when>
            <xsl:otherwise>
              <courtfiling:citedauthorities>
                <xsl:apply-templates select="heading"/>
                <bodytext>
                  <!--SP: For CA19, there is currently no need to process the referencetype attribute on case:references-->
                  <xsl:apply-templates select=" node() except (heading | @referencetype)"/>
                </bodytext>
              </courtfiling:citedauthorities>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <!-- Awantika: Please add stream ID as per the requirement -->
        <xsl:when test="$streamID=('CA01','CA02CC','CA04','CA05')">
          <xsl:choose>
            <xsl:when test="count($references//ext:reference[starts-with($case-data,./@key)[1]])>0">
              <ref:relatedrefs>
                <xsl:attribute name="referencetype">
                  <xsl:value-of select="($references//ext:reference[starts-with($case-data,./@key)[1]]/@value)[1]"/>
                </xsl:attribute>
                <!-- Awantika: Updated if heading is coming -->
                <xsl:apply-templates select="heading"/>
                <bodytext>
                  <xsl:apply-templates select="@* | node() except heading"/>
                </bodytext>
              </ref:relatedrefs>
            </xsl:when>
            <xsl:otherwise>
              <ref:relatedrefs>
                <xsl:apply-templates select="heading"/>
                <bodytext>
                  <xsl:apply-templates select="@* | node() except heading"/>
                </bodytext>
              </ref:relatedrefs>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:otherwise>
          <ref:relatedrefs>
            <xsl:apply-templates select="@*"/>
            <xsl:apply-templates select="heading"/>
            <bodytext>
              <xsl:apply-templates select="node() except heading"/>
            </bodytext>
          </ref:relatedrefs>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:references/heading/title/text()
    Namespace No namespace
    Match case:references/heading/title/text()
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:references/heading/title/text()">
      <xsl:value-of select="replace(.,': ','')"/>
    </xsl:template>
    Template case:references/@referencetype
    Documentation

    Description

     JD: 2017-06-15: adding for UK01; although it's not mentioned in the CI it is shown in examples.
    	Hard to see any downside to mapping case:references/@referencytype to ref:relatedrefs/@referencetype
    	
    Namespace No namespace
    Match case:references/@referencetype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:references/@referencetype">
      <xsl:attribute name="referencetype" select="."/>
    </xsl:template>
    Template case:citations
    Documentation

    Description

    • case:citations becomes ref:relatedrefs with an attribute 'referencetype' set to @referencetype="case-citations" which contains case:citetext becomes ref:relatedrefs/bodytext/p/text
      
      <case:citations>
        <heading>
          <title>C<emph typestyle="smcaps">ASES</emph> C<emph typestyle="smcaps">ITED</emph></title>
        </heading>
        <case:citetext>The following cases are cited in the judgment:<nl/>
          <ci:cite searchtype="CASE-REF">
            <ci:content>
              <citefragment searchtype="CASE-NAME-REF"><emph typestyle="it">Allgood v Blake</emph></citefragment> 
              <citefragment searchtype="CASE-CITE-REF">(1873) LR 8 Exch 160</citefragment>.
            </ci:content>
          </ci:cite><nl/>
          <ci:cite searchtype="CASE-REF">
            <ci:content>
              <citefragment searchtype="CASE-NAME-REF"><emph typestyle="it">Amber Holdings (Aust) Pty Ltd v Polona Pty Ltd</emph></citefragment> 
              <citefragment searchtype="CASE-CITE-REF">[1982] 2 NSWLR 470</citefragment>.
            </ci:content>
          </ci:cite><nl/>
        </case:citetext>
      </case:citations>
      Becomes:
      
      <ref:relatedrefs referencetype="case-citations">
        <heading>
          <title>C<emph typestyle="smcaps">ASES</emph> C<emph typestyle="smcaps">ITED</emph></title>
        </heading>
        <bodytext>
          <p>
            <text>The following cases are cited in the judgment:<proc:nl/>
              <lnci:cite type="case">
                <lnci:content>
                  <emph typestyle="it">Allgood v Blake</emph> (1873) LR 8 Exch 160
                </lnci:content>
              </lnci:cite><proc:nl/>
              <lnci:cite type="case">
                <lnci:content>
                  <emph typestyle="it">Amber Holdings (Aust) Pty Ltd v Polona Pty Ltd</emph> [1982] 2 NSWLR 470
                </lnci:content>
              </lnci:cite><proc:nl/>
            </text>
          </p>
        </bodytext>
      </ref:relatedrefs>
      

    Description

    <xsl:template match="">
    
    		<!-\-  Original Target XPath:  Avocats   -\->
    		
    
    	</xsl:template>
    
    	<xsl:template match="Avocats :">
    
    		<!-\-  Original Target XPath:  Avocats   -\->
    		<Avocats>
    			<xsl:apply-templates select="@* | node()"/>
    		</Avocats>
    
    	</xsl:template>
    
    	<xsl:template match="Cases cited:">
    
    		<!-\-  Original Target XPath:  Casescited   -\->
    		<Casescited>
    			<xsl:apply-templates select="@* | node()"/>
    		</Casescited>
    
    	</xsl:template>
    
    	<xsl:template match="Cases Cited:">
    
    		<!-\-  Original Target XPath:  CasesCited   -\->
    		<CasesCited>
    			<xsl:apply-templates select="@* | node()"/>
    		</CasesCited>
    
    	</xsl:template>
    
    	<xsl:template match="Jurisprudence cite :">
    
    		<!-\-  Original Target XPath:  Jurisprudencecite   -\->
    		<Jurisprudencecite>
    			<xsl:apply-templates select="@* | node()"/>
    		</Jurisprudencecite>
    
    	</xsl:template>
    
    	<xsl:template match="Statutes, Regulations and Rules Cited:">
    
    		<!-\-  Original Target XPath:  Statutes,RegulationsandRulesCited   -\->
    		<!-\-  Could not determine target element or attribute name:  <Statutes,RegulationsandRulesCited>  -\->			<xsl:apply-templates select="@* | node()"/>
    		<!-\-  Could not determine target element or attribute name:  </Statutes,RegulationsandRulesCited>  -\->
    
    	</xsl:template>
    
    	<xsl:template match="Législation citée :">
    
    		<!-\-  Original Target XPath:  Législationcitée   -\->
    		<!-\-  Could not determine target element or attribute name:  <Législationcitée>  -\->			<xsl:apply-templates select="@* | node()"/>
    		<!-\-  Could not determine target element or attribute name:  </Législationcitée>  -\->
    
    	</xsl:template>
    
    	<xsl:template match="Authors and Texts Cited:">
    
    		<!-\-  Original Target XPath:  AuthorsandTextsCited   -\->
    		<AuthorsandTextsCited>
    			<xsl:apply-templates select="@* | node()"/>
    		</AuthorsandTextsCited>
    
    	</xsl:template>
    
    	<xsl:template match="Texts Cited:">
    
    		<!-\-  Original Target XPath:  TextsCited   -\->
    		<TextsCited>
    			<xsl:apply-templates select="@* | node()"/>
    		</TextsCited>
    
    	</xsl:template>
    
    	<xsl:template match="Causes citées et consultées :">
    
    		<!-\-  Original Target XPath:  Causescitéesetconsultées   -\->
    		<!-\-  Could not determine target element or attribute name:  <Causescitéesetconsultées>  -\->			<xsl:apply-templates select="@* | node()"/>
    		<!-\-  Could not determine target element or attribute name:  </Causescitéesetconsultées>  -\->
    
    	</xsl:template>
    
    	<xsl:template match="Jurisprudence et doctrine citées et consultées :">
    
    		<!-\-  Original Target XPath:  Jurisprudenceetdoctrinecitéesetconsultées   -\->
    		<!-\-  Could not determine target element or attribute name:  <Jurisprudenceetdoctrinecitéesetconsultées>  -\->			<xsl:apply-templates select="@* | node()"/>
    		<!-\-  Could not determine target element or attribute name:  </Jurisprudenceetdoctrinecitéesetconsultées>  -\->
    
    	</xsl:template>
    
    	<xsl:template match="Doctrine et jurisprudence citées :">
    
    		<!-\-  Original Target XPath:  Doctrineetjurisprudencecitées   -\->
    		<!-\-  Could not determine target element or attribute name:  <Doctrineetjurisprudencecitées>  -\->			<xsl:apply-templates select="@* | node()"/>
    		<!-\-  Could not determine target element or attribute name:  </Doctrineetjurisprudencecitées>  -\->
    
    	</xsl:template>
    
    	<xsl:template match="Doctrine citée :">
    
    		<!-\-  Original Target XPath:  Doctrinecitée   -\->
    		<!-\-  Could not determine target element or attribute name:  <Doctrinecitée>  -\->			<xsl:apply-templates select="@* | node()"/>
    		<!-\-  Could not determine target element or attribute name:  </Doctrinecitée>  -\->
    
    	</xsl:template>
    
    	<xsl:template match="Counsel:">
    
    		<!-\-  Original Target XPath:  Counsel   -\->
    		<Counsel>
    			<xsl:apply-templates select="@* | node()"/>
    		</Counsel>
    
    	</xsl:template>
     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.citations-LxAdv_ref.relatedrefs.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.citations-LxAdv_ref.relatedrefs.dita  
    Namespace No namespace
    Match case:citations
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:citations">
      <ref:relatedrefs>
        <xsl:attribute name="referencetype">
          <xsl:text>case-citations</xsl:text>
        </xsl:attribute>
        <xsl:apply-templates select="@* | node()"/>
      </ref:relatedrefs>
    </xsl:template>
    Template case:citations/case:citetext
    Documentation

    Description

      <xsl:template match="case:citations/case:citetext">
        
          <bodytext>
            <p>
              <text>
                <xsl:apply-templates select="@* | node() except heading"/>
              </text>
            </p>
          </bodytext>
        
      </xsl:template>
    Namespace No namespace
    Match case:citations/case:citetext
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:citations/case:citetext">
      <xsl:variable name="name" select="local-name()"/>
      <xsl:if test="local-name(preceding-sibling::*[position()=1]) != $name">
        <bodytext>
          <p>
            <text>
              <xsl:apply-templates/>
            </text>
          </p>
          <!-- Match the next sibling if it has the same name -->
          <xsl:apply-templates select="following-sibling::*[1][local-name()=$name]" mode="next"/>
        </bodytext>
      </xsl:if>
    </xsl:template>
    Template case:citations/case:citetextnext
    Namespace No namespace
    Match case:citations/case:citetext
    Mode next
    Import precedence 0
    Source
    <xsl:template match="case:citations/case:citetext" mode="next">
      <xsl:variable name="name" select="local-name()"/>
      <p>
        <text>
          <xsl:apply-templates/>
        </text>
      </p>
      <xsl:apply-templates select="following-sibling::*[1][local-name()=$name]" mode="next"/>
    </xsl:template>
    Template case:disposition[parent::case:headnote]summaries
    Documentation

    Description

    The attributes of case:disposition are handled as follows:

    • case:disposition/@subdoc becomes casesum:disposition/@includeintoc.
    • case:disposition/@toc-caption becomes casesum:disposition/@alternatetoccaption.

    Note: case:disposition occurs in two contexts. The full mappings from Rosetta to NL are as follows:

    • CASEDOC/case:body/case:headnote/case:disposition becomes courtcase:head/casesum:summaries/casesum:disposition.
    • CASEDOC/case:body/case:content/case:judgments/case:disposition becomes courtcase:body/courtcase:opinions/casesum:disposition.

    Note: Conversion should not create consecutive casesum:summaries elements. When 2 or more consecutive sibling source elements map to casesum:summaries, target data should be merged to a single casesum:summaries element unless this would hamper content ordering.

    Note:

    For information on how to process the attribute @ln.user-displayed. Refer common_rosetta_ln.user_displayed for handling of @ln.user-displayed

    <case:disposition>Appeal dismissed.</case:disposition>
           
    becomes
    <casesum:disposition>
        <p>
          <text>Appeal dismissed.</text>
        </p>
    </casesum:disposition>
           

    Description

     <xsl:template match="case:citations" mode="summaries">
    	  <ref:relatedrefs>		
    	    <xsl:attribute name="referencetype">
    	      <xsl:text>case-citations</xsl:text>
    	    </xsl:attribute>
    	    <xsl:if test="child::heading">
    	      <xsl:apply-templates select="heading"/>                   
    	    </xsl:if>
    	    <xsl:if test="node() except heading">
    	      <bodytext>
    	        <xsl:choose>
    	          <xsl:when test="child::case:citetext">
    	            <p>
    	              <text>
    	                <xsl:apply-templates select="@* | node() except heading"/>
    	              </text>
    	            </p>
    	          </xsl:when>
    	          <xsl:otherwise>
    	            <xsl:apply-templates select="@* | node() except heading"/>
    	          </xsl:otherwise>
    	        </xsl:choose>
    	      </bodytext>
    	    </xsl:if>
    	  </ref:relatedrefs>
    	</xsl:template>
     Awantika: Completed 
     <topicref href="AU01_Rosetta_case.disposition-LxAdv_casesum.disposition.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.disposition-LxAdv_casesum.disposition.dita  
     Awantika: 2017-10-30-Added <text> after <p>
    Namespace No namespace
    Match case:disposition[parent::case:headnote]
    Mode summaries
    Import precedence 0
    Source
    <xsl:template match="case:disposition[parent::case:headnote]" mode="summaries">
      <!--  Original Target XPath:  casesum:disposition/@includeintoc   -->
      <xsl:choose>
        <xsl:when test="@ln.user-displayed='false'"/>
        <xsl:otherwise>
          <casesum:disposition>
            <p>
              <text>
                <xsl:if test="@subdoc">
                  <xsl:attribute name="includeintoc">
                    <xsl:value-of select="@subdoc"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:if test="@toc-caption">
                  <xsl:attribute name="alternatetoccaption">
                    <xsl:value-of select="@toc-caption"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:apply-templates select="@* | node()"/>
              </text>
            </p>
          </casesum:disposition>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:disposition[parent::case:judgments]
    Namespace No namespace
    Match case:disposition[parent::case:judgments]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:disposition[parent::case:judgments]">
      <!--  Original Target XPath:  casesum:disposition/@includeintoc   -->
      <xsl:choose>
        <xsl:when test="@ln.user-displayed='false'"/>
        <xsl:otherwise>
          <casesum:disposition>
            <p>
              <text>
                <xsl:if test="@subdoc">
                  <xsl:attribute name="includeintoc">
                    <xsl:value-of select="@subdoc"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:if test="@toc-caption">
                  <xsl:attribute name="alternatetoccaption">
                    <xsl:value-of select="@toc-caption"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:apply-templates select="@* | node()"/>
              </text>
            </p>
          </casesum:disposition>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:body
    Documentation

    Description

    case:body becomes courtcase:body.


    Description

    <xsl:include href="../../modules/case/case.citations_case.citetext.xsl"/>
     end topichead  Headnote  
     <topicref href="../../common_caselaw/Rosetta_case.body-LxAdv_courtcase.body.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.body-LxAdv_courtcase.body.dita  
    <xsl:message>Rosetta_case.body-LxAdv_courtcase.body.xsl requires manual development!</xsl:message> 
    WSS: Done - case:bdoy 
    Namespace No namespace
    Match case:body
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:body">
      <!--  Original Target XPath:  courtcase:body   -->
      <courtcase:body>
        <!-- Vikas Rohilla : added for the streamID = CA01			-->
        <xsl:apply-templates select="//case:info/case:constituents[not(ancestor::case:appendix)][$streamID='CA01']"/>
        <!--Satbir: Define these element "case:typeofcase and case:judgement" as a optional for maintain order of elements-->
        <xsl:apply-templates select="case:content/case:typeofcase | case:content/case:judgments"/>
        <!--<xsl:apply-templates select="case:content/case:judgments"/>-->
        <!--<xsl:apply-templates select="case:content/case:judgments/case:judgment/case:courtinfo/case:judges[ancestor::case:content]"/>-->
        <!--<xsl:apply-templates select="case:content/case:judgments/case:constituents"/>-->
        <!--<xsl:apply-templates select="case:content/case:judgments/case:disposition"/>-->
        <!--<xsl:apply-templates select="case:content/case:judgments/case:appendix"/>-->
        <xsl:apply-templates select="case:courtinfo"/>
        <xsl:apply-templates select="case:content/case:author"/>
        <xsl:apply-templates select="case:content/case:appendix[not(parent::case:judgments)]|case:content/case:appendix[$streamID='CA01']"/>
        <xsl:apply-templates select="case:content/page"/>
        <!-- JD: 2017-12-01: supporting dropped <note> content per email from Chuck 2017-12-01/10:41AM.
    			Rather than specifically process just <note>, process anything not handled above.  Limit to UK01 for now.  
    			-->
        <xsl:if test="$streamID='UK01'">
          <xsl:apply-templates select="case:content/* except(case:content/case:typeofcase,case:content/case:judgments,case:content/case:author,case:content/case:appendix,case:content/page)"/>
        </xsl:if>
        <!--			<xsl:apply-templates select="case:content/case:author"/>-->
        <!--<xsl:apply-templates select="case:content/case:judgments"/>
    			<xsl:apply-templates select="case:content/page"/>
    			<xsl:apply-templates select="case:content/case:typeofcase"/>
    			<xsl:apply-templates select="case:content/case:appendix[not(parent::case:judgments)]"/>
    			
    			<xsl:apply-templates select="case:content/case:judgments/case:constituents"/>
    			<xsl:apply-templates select="case:content/case:author"/>
    			<xsl:apply-templates select="@* | node() except case:info[parent::case:headnote]"/>-->
      </courtcase:body>
    </xsl:template>
    Template inlineobjectcitator-ref
    Namespace No namespace
    Match inlineobject
    Mode citator-ref
    Import precedence 0
    Source
    <xsl:template match="inlineobject" mode="citator-ref">
      <xsl:if test="contains(@alttext , 'Click for CaseBase entry')">
        <xsl:attribute name="referencedresourcesentiment">
          <xsl:choose>
            <xsl:when test="starts-with(@alttext , 'Citation')">
              <xsl:text>none</xsl:text>
            </xsl:when>
            <xsl:when test="starts-with(@alttext , 'Positive')">
              <xsl:text>positive</xsl:text>
            </xsl:when>
            <xsl:when test="starts-with(@alttext , 'Neutral')">
              <xsl:text>neutral</xsl:text>
            </xsl:when>
            <xsl:when test="starts-with(@alttext , 'Negative')">
              <xsl:text>negative</xsl:text>
            </xsl:when>
            <xsl:when test="starts-with(@alttext , 'Cautionary')">
              <xsl:text>cautionary</xsl:text>
            </xsl:when>
            <xsl:when test="starts-with(@alttext , 'Click')">
              <xsl:text>none</xsl:text>
            </xsl:when>
          </xsl:choose>
        </xsl:attribute>
      </xsl:if>
    </xsl:template>
    Template case:typeofcase
    Documentation

    Description

    Note: If page element occurs as direct child of case:content then conversion need to move ref:page as direct child of courtcase:body, i.e, case:content/page becomes courtcase:body/ref:page.

    Note: If case:appendix element occurs as direct child of case:content then conversion need to move attachments/appendix as direct child of courtcase:body, i.e, case:content/case:appendix becomes courtcase:body/attachments/appendix.


    Description

    case:typeofcase becomes courtcase:body/casesum:summaries/casesum:editorialsummary/casesum:overview.

    With the exception of heading, all children of case:typeofcase should be mapped to children of casesum:overview/bodytext.

    Note: Conversion should not create consecutive casesum:summaries elements. When 2 or more consecutive sibling source elements map to casesum:summaries, target data should be merged to a single casesum:summaries element unless this would hamper content ordering.

    Example: AU content

    <case:typeofcase>
        <heading>
            <title>Application</title>
        </heading>
        <p>
            <text>This was an application by notice of motion to amend an application to the tribunal for the restoration of credit charges to certain contracts.</text>
        </p>
    </case:typeofcase>
           
    becomes
    <casesum:overview>
        <heading>
            <title>Application</title>
        </heading>
        <bodytext>
            <p>
                <text>This was an application by notice of motion to amend an application to the tribunal for the restoration of credit charges to certain contracts.</text>
            </p>
        </bodytext>
    </casesum:overview>
           

    Example: NZ content

    <case:typeofcase>
        <heading>
            <title>ACTION</title>
        </heading>
        <p>
            <text>claiming writs of certiorari and prohibition and a declaration.</text>
        </p>
        <p>
            <text>Early in the month of September 1959, Mrs Kettle (the second defendant) became the licensee under a wholesale licence in respect of certain premises situated at Waite Street, Greymouth. Shortly afterwards she filed applications (1) for a temporary transfer of the licence pursuant to s. 120 of the Licensing Act 1908 to a limited company called Kettle Bros. Ltd. (the third defendant) and (2) for a permanent transfer of the licence pursuant to ss. 118 and 119 of the Act to the same company. The temporary transfer was granted on 29 September 1959 with the effect set out in s. 120 (3) of the Act &#x2014; namely, to authorise Kettle Bros. Ltd. to carry on the business specified in the licence at the Waite Street premises until the next quarterly licensing meeting to be held by the Westland District Licensing Committee (the first defendant, hereinafter called &quot;the Licensing Committee&#x0022;).</text>
        </p>
    </case:typeofcase>
           
    becomes
    <casesum:overview>
        <heading>
            <title>ACTION</title>
        </heading>
        <bodytext>
            <p>
                <text>claiming writs of certiorari and prohibition and a declaration.</text>
            </p>
            <p>
                <text>Early in the month of September 1959, Mrs Kettle (the second defendant) became the licensee under a wholesale licence in respect of certain premises situated at Waite Street, Greymouth. Shortly afterwards she filed applications (1) for a temporary transfer of the licence pursuant to s. 120 of the Licensing Act 1908 to a limited company called Kettle Bros. Ltd. (the third defendant) and (2) for a permanent transfer of the licence pursuant to ss. 118 and 119 of the Act to the same company. The temporary transfer was granted on 29 September 1959 with the effect set out in s. 120 (3) of the Act &#x2014; namely, to authorise Kettle Bros. Ltd. to carry on the business specified in the licence at the Waite Street premises until the next quarterly licensing meeting to be held by the Westland District Licensing Committee (the first defendant, hereinafter called &quot;the Licensing Committee&#x0022;).</text>
            </p>
        </bodytext>
    </casesum:overview>
           

    Example: AU content

    <case:typeofcase>
        <pgrp>
            <heading>
                <title>Appeal</title>
            </heading>
            <p>
                <text>This was an appeal by the one of the defendants against a decision of Mandie&#160;J in the Trial Division awarding the plaintiffs damages in a claim brought against the defendant investment advisers pursuant to s&#160;819 of the Corporations Law. The facts are stated in the judgment.</text>
            </p>
        </pgrp>
    </case:typeofcase>
           
    becomes
    <casesum:overview>
        <bodytext>
            <pgrp>
                <heading>
                    <title>Appeal</title>
                </heading>
                <p>
                    <text>This was an appeal by the one of the defendants against a decision of Mandie J in the Trial Division awarding the plaintiffs damages in a claim brought against the defendant investment advisers pursuant to s 819 of the Corporations Law. The facts are stated in the judgment.</text>
                </p>
            </pgrp>
        </bodytext>
    </casesum:overview>
           

    Example: NZ content

    <case:typeofcase>
        <p>
            <text>MOTION for argument of questions of law on the pleadings in the action.</text>
        </p>
        <p>
            <text>The statement of claim alleged&mdash;</text>
        </p>
        <l>
            <li>
                <lilabel>&#160;</lilabel>
                <p>
                    <text>1. That the plaintiff was a member of the Church of England and a parishioner of the Parish of Avonside, and the defendant was the incumbent of the said parish.</text>
                </p>
            </li>
        </l>
        <l>
            <li>
                <lilabel>&#160;</lilabel>
                <p>
                    <text>2. That on Sunday, the 23rd of September, 1889, the defendant as such incumbent held the service of the Holy Communion, and that the plaintiff attended the service and duly presented herself to receive the Sacrament of the Holy Communion.</text>
                </p>
            </li>
        </l>
    </case:typeofcase>
           
    becomes
    <casesum:overview>
        <bodytext>
            <p>
                <text>MOTION for argument of questions of law on the pleadings in the action.</text>
            </p>
            <p>
                <text>The statement of claim alleged&#x2014;</text>
            </p>
            <list>
                <listitem>
                    <label> </label>
                    <p>
                        <text>1. That the plaintiff was a member of the Church of England and a parishioner of the Parish of Avonside, and the defendant was the incumbent of the said parish.</text>
                    </p>
                </listitem>
            </list>
            <list>
                <listitem>
                    <label> </label>
                    <p>
                        <text>2. That on Sunday, the 23rd of September, 1889, the defendant as such incumbent held the service of the Holy Communion, and that the plaintiff attended the service and duly presented herself to receive the Sacrament of the Holy Communion.</text>
                    </p>
                </listitem>
            </list>
        </bodytext>
    </casesum:overview>
           

    Description

     start topichead  CaseContent  
     <topicref href="AU01_Rosetta_case.content.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.content.dita  
    <xsl:message>AU01_Rosetta_case.content.xsl requires manual development!</xsl:message>
    SS: Working
    <xsl:template match="case:content/child::page"/>
        <xsl:template match="case:content/child::appendix"/>
        <xsl:template match="case:content/child::case:typeofcase"/>
     <topicref href="../../common_caselaw/Rosetta_case.typeofcase-LxAdv_casesum.overview.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.typeofcase-LxAdv_casesum.overview.dita  
    <xsl:message>Rosetta_case.typeofcase-LxAdv_casesum.overview.xsl requires manual development!</xsl:message>
    WSS: Done case:typeofcase
    Satbir: Correct ordering of case:typeofcase
    Namespace No namespace
    Match case:typeofcase
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:typeofcase">
      <casesum:summaries>
        <casesum:editorialsummary>
          <casesum:overview>
            <xsl:apply-templates select="heading"/>
            <bodytext>
              <xsl:apply-templates select="@* | node() except heading"/>
            </bodytext>
          </casesum:overview>
        </casesum:editorialsummary>
      </casesum:summaries>
      <!--  <xsl:choose>
    	        <xsl:when test="./parent::case:content">
    	           
    	                <casesum:editorialsummary>
    	                    <casesum:overview>
    	                        <xsl:apply-templates select="heading"/>
    	                        <bodytext>
    	                           <xsl:apply-templates select="@* | node() except heading"/>
    	                        </bodytext>
    	                    </casesum:overview>
    	                </casesum:editorialsummary>
    	            
    	        </xsl:when>
    	        <xsl:otherwise>
    	            <casesum:overview>
    	                <xsl:apply-templates select="heading"/>
    	                <bodytext>
    	                    <xsl:apply-templates select="@* | node() except heading"/>
    	                </bodytext>
    	            </casesum:overview>
    	        </xsl:otherwise>
    	    </xsl:choose>-->
    </xsl:template>
    Template case:judgments
    Documentation

    Description

    The optional attributes of case:judgments are handled as follows:

    • case:judgments/@subdoc becomes courtcase:opinions/@includeintoc.
    • case:judgments/@toc-caption becomes courtcase:opinions/@alternatetoccaption.

    Note: The child element attachments is used to house inlineobject information in the opinions. The LBU indicated that this use case is for attachments.

    <case:judgments>
        ...
        <inlineobject filename="g0607831d.gif" attachment="ln-server" type="image"/>
        ...
    </case:judgments>
           
    becomes
    <courtcase:opinions>
        ...
        <attchments>
            <appendix>
                <bodytext>
                    <figure>
                        <ref:inlineobject>
                            <ref:locator>
                                <ref:locator-key>
                                    <ref:key-name name="object-key"/>
                                    <ref:key-value value="X-Y-g0607831d"/>
                                </ref:locator-key>
                                <ref:locator-params>
    								<proc:param name="componentseq" value="1"/>
                                    <proc:param name="object-type" value="image"/>
    								<proc:param name="object-smi" value=""/>
                                </ref:locator-params>
                            </ref:locator>
                        </ref:inlineobject>
                    </figure>
                </bodytext>
            </appendix>
        </attchments>
        ...
    </courtcase:opinions>
           

    When case:dates appears as direct of case:judgments then conversion need to omit tag (case:dates) and retain content in this particular context and create decision:decisiondate as direct child of courtcase:opinions, i.e., case:judgments/case:dates/case:decisiondate becomes courtcase:opinions/decision:decisiondate.

    The attribute decision:decisiondate/@normdate should be populated with the values of case:decisiondate/date/@year, case:decisiondate/date/@month and case:decisiondate/date/@day concatenated and separated by a single hyphen. The values of case:decisiondate/date/@month and case:decisiondate/date/@day should be padded with zeroes so that they are 2 digits.

    Note: If one or more of the three date values (year, month or day) are absent, then decision:decisiondate/@normdate should not be populated.

    <case:judgments>
        <case:dates>
            <case:decisiondate>
                <date year="1986" month="07" day="01">1 July 1986</date> 
            </case:decisiondate>
        </case:dates>
        ...
    </case:judgments>
           
    becomes
    <courtcase:opinions>
        <decision:decisiondate day="01" month="07" year="1986" normdate="1986-07-01">
            <date-text>1 July 1986</date-text> 
        </decision:decisiondate>
        ...
    </courtcase:opinions>
           

    Changes Specific to AU01

    2013-05-02: Updated target example to reflect changes per latest Apollo markup.

    2013-05-02: Created.


    Description

     <topicref href="AU01_Rosetta_case.judgments-LxAdv_courtcase.opinions.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.judgments-LxAdv_courtcase.opinions.dita  
    SS: Done "AU01_Rosetta_case.judgments-LxAdv_courtcase.opinions"
    Namespace No namespace
    Match case:judgments
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judgments">
      <courtcase:opinions>
        <xsl:choose>
          <xsl:when test="./@subdoc">
            <xsl:attribute name="includeintoc">
              <xsl:value-of select="."/>
            </xsl:attribute>
          </xsl:when>
          <xsl:when test="./@toc-caption">
            <xsl:attribute name="alternatetoccaption">
              <xsl:value-of select="."/>
            </xsl:attribute>
          </xsl:when>
          <xsl:when test="./@searchtype"/>
          <xsl:when test="child::inlineoject">
            <attchments>
              <appendix>
                <bodytext>
                  <figure>
                    <xsl:apply-templates select="inlineobject"/>
                  </figure>
                </bodytext>
              </appendix>
            </attchments>
          </xsl:when>
          <xsl:when test="child::case:dates and descendant::case:decisiondate">
            <xsl:apply-templates select="case:decisiondate"/>
          </xsl:when>
        </xsl:choose>
        <xsl:apply-templates select="@* | node() except inlineobject except case:decisiondate"/>
      </courtcase:opinions>
    </xsl:template>
    Template case:judgment
    Documentation

    Description

    The optional attributes of case:judgment are handled as follows:

    • case:judgment/@subdoc becomes courtcase:opinion/@includeintoc.
    • case:judgment/@toc-caption becomes courtcase:opinion/@alternatetoccaption.
    • case:judgment/@searchtype should be suppressed.

    <case:judgment subdoc="true" toc-caption="Perram  J.">
      <case:judgmentbody>
        <pgrp>
          <heading>
            <title>Background</title>
          </heading>
          <p>
            <pnum count="1">[1]</pnum>
            <text>The present applicants are five individuals who at one time or another were engaged by
              Combined Insurance Company of America (Combined) as insurance agents. In recent times, the
              five have sued Combined in the Chief Industrial Magistrates&#x2019; Court of New South
              Wales claiming entitlements both to annual leave and long service leave. One of the
              principal issues to be resolved in those proceedings is the question of whether the agents
              were employees of Combined, as they contend, or rather independent contractors, as
              Combined contends. No doubt the resolution of that issue will involve a close
              consideration of a broad range of indicia. One of the matters to which Combined points is
              a term in its contract with each agent by which each agreed, or appears to have agreed,
              that his relationship with Combined was not one of employment.</text>
          </p>
        </pgrp>
      </case:judgmentbody>
    </case:judgment>
           
    becomes
    <courtcase:opinion includeintoc="true" alternatetoccaption="Perram  J.">
      <bodytext>
        <pgrp>
          <heading>
            <title>Background</title>
          </heading>
          <p>
            <desig value="1">[1]</desig>
            <text>The present applicants are five individuals who at one time or another were engaged by
              Combined Insurance Company of America (Combined) as insurance agents. In recent times, the
              five have sued Combined in the Chief Industrial Magistrates&#x2019; Court of New South
              Wales claiming entitlements both to annual leave and long service leave. One of the
              principal issues to be resolved in those proceedings is the question of whether the agents
              were employees of Combined, as they contend, or rather independent contractors, as
              Combined contends. No doubt the resolution of that issue will involve a close
              consideration of a broad range of indicia. One of the matters to which Combined points is
              a term in its contract with each agent by which each agreed, or appears to have agreed,
              that his relationship with Combined was not one of employment.</text>
          </p>
        </pgrp>
      </bodytext>
    </courtcase:opinion>
           

    Description

     <topicref href="AU01_Rosetta_case.judgment-LxAdv_courtcase.opinion.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.judgment-LxAdv_courtcase.opinion.dita  
    SS: Done "AU01_Rosetta_case.judgment-LxAdv_courtcase.opinion"
    Namespace No namespace
    Match case:judgment
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judgment">
      <courtcase:opinion>
        <xsl:if test="./@subdoc">
          <xsl:attribute name="includeintoc">
            <xsl:value-of select="./@subdoc"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="./@toc-caption">
          <xsl:attribute name="alternatetoccaption">
            <xsl:value-of select="./@toc-caption"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="./@searchtype"/>
        <xsl:apply-templates select="case:courtinfo/case:judges[ancestor::case:content]"/>
        <xsl:apply-templates select="@* | node() except case:courtinfo"/>
      </courtcase:opinion>
    </xsl:template>
    Template @toc-caption | @subdoc | @searchtype
    Namespace No namespace
    Match @toc-caption | @subdoc | @searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="@toc-caption | @subdoc | @searchtype"/>
    Template case:judges[ancestor::case:headnote]
    Documentation

    Description

    • There are two contexts for /case:judges/case:judge in Standard Rosetta along with NL Xpath:
    • /CASEDOC/case:body/case:headnote/case:info/case:courtinfo/case:judges/case:judge, NL Xpath: /courtcase:courtcase/courtcase:head/caseinfo:caseinfo/courtcase:panel/courtcase:judges/person:judge
    • /CASEDOC/case:body/case:content/case:judgments/case:judgment/case:courtinfo/case:judges/case:judge, NL Xpath: /courtcase:courtcase/courtcase:body/courtcase:opinions/courtcase:opinion/courtcase:opinionby/person:judge
    • Note: Conversion should not create consecutive caseinfo:caseinfo elements. When 2 or more consecutive sibling source elements map to caseinfo:caseinfo, data should be merged to a single caseinfo:caseinfo element unless this would hamper content ordering.

      Note: Any nl elements inside case:judges should be suppressed.

      case:judge becomes person:judge
      
      <case:judges>
          <case:judge>Perram</case:judge> J
      </case:judges>
      Becomes
      
      <courtcase:opinionby>
          <person:judge>Perram</person:judge> J
      </courtcase:opinionby>
      
      OR
      
      <courtcase:panel>
          <courtcase:judges>
              <person:judge>Perram</person:judge> J
          </courtcase:judges>
      <courtcase:panel>
      

      Note: Capture PCData for judges markup as is in New Lexis and always create person:judge as an immediate child of courtcase:judges or courtcase:opinionby. For example: if there is a Rosetta case:judges element and it just contains text then conversion need to create person:judge as a child of courtcase:judges or courtcase:opinionby.

      
      <case:judges>
          Glazebrook, O’Regan and Baragwanath JJ
      </case:judges>
      Becomes
      
      <courtcase:opinionby>
          <person:judge>Glazebrook, O’Regan and Baragwanath JJ</person:judge>
      </courtcase:opinionby>
      
      OR
      
      <courtcase:panel>
          <courtcase:judges>
              <person:judge>Glazebrook, O’Regan and Baragwanath JJ</person:judge>
          </courtcase:judges>
      <courtcase:panel>
      

      Note: When emph is inside case:judges and @typestyle="smcaps" then conversion need to omit tag (emph) and retain content.

      
      <case:judgment>
        <case:courtinfo>
            <case:judges>
                JUDGE M 
                <emph typestyle="smcaps">c</emph> 
                ELREA. 
            </case:judges>
        </case:courtinfo>
        ...
      </case:judgment>
      
      Becomes
      
      <courtcase:opinion>
        <courtcase:opinionby>
          JUDGE M 
          c
          ELREA. 
        </courtcase:opinion>
      </courtcase:opinion>
      
      

      Note: Connecting punctuation and newlines or label text ending with a colon preceding judges can be accomodated in the judges markup. The colon should not be copied into the target xml however.

      Note: A colon is inserted before case:judges in rosetta xml. In rosetta this colon is used as a separator, that will be handled in presentation spec for New Lexis for all cases.

      
      <case:info>
          ...
          <case:courtinfo>
              <case:juris>NSW</case:juris> 
              <case:courtname>Equity Division</case:courtname> 
              <case:courtcode>NSWSC</case:courtcode> 
              <nl/>
              -
              <case:judges>
                  <case:judge>Young J</case:judge> 
              </case:judges>
              <case:dates>
                  <case:hearingdates>10 June; 1 July 1986</case:hearingdates> 
              </case:dates>
          </case:courtinfo>
      </case:info>
      
      Becomes
      
      <caseinfo:caseinfo>
          ...
          <courtcase:panel>
              <courtcase:judges>
                  <proc:nl/>
                  -
                  <person:judge>Young J</person:judge> 
              </courtcase:judges>
          </courtcase:panel>
          ...
      </caseinfo:caseinfo>
      
      
      <case:info>
          ...
          <case:courtinfo>
              <case:juris>NSW</case:juris> 
              <case:courtname>Equity Division</case:courtname> 
              <case:courtcode>NSWSC</case:courtcode>:
              <case:judges>
                  <case:judge>Young J</case:judge> 
              </case:judges>
              <case:dates>
                  <case:hearingdates>10 June; 1 July 1986</case:hearingdates> 
              </case:dates>
          </case:courtinfo>
      </case:info>
      
      Becomes
      
      <caseinfo:caseinfo>
          ...
          <courtcase:panel>
              <courtcase:judges>
                  <person:judge>Young J</person:judge> 
              </courtcase:judges>
          </courtcase:panel>
          ...
      </caseinfo:caseinfo>    
          
      
       <case:info>
       ...
         <case:courtinfo>
           <case:juris>NSW</case:juris>
           <case:courtname>Common Law Division</case:courtname>
           <case:courtcode>NSWSC</case:courtcode>—Commercial List:
             <case:judges>
               <case:judge>Young J</case:judge>
             </case:judges>
      
             <case:dates>
                <case:hearingdates>June 19; July 14, 1981</case:hearingdates>
             </case:dates>
          </case:courtinfo>
      </case:info>
      
      Becomes
       <caseinfo:caseinfo>
        ...
         <courtcase:panel>
            <courtcase:judges>—Commercial List
               <person:judge>Young J</person:judge>
            </courtcase:judges>
         </courtcase:panel>
        ...
       </caseinfo:caseinfo>
      
      

    Description

     <topicref href="AU01_Rosetta_case.judges.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.judges.dita  
    SS: Done "AU01_Rosetta_case.judges"
    Namespace No namespace
    Match case:judges[ancestor::case:headnote]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:judges[ancestor::case:headnote]">
      <xsl:choose>
        <xsl:when test="@ln.user-displayed='false'"/>
        <xsl:otherwise>
          <courtcase:panel>
            <courtcase:judges>
              <!--SS: Added below condition for moving text() of case:courtinfo under target element courtcase:judges-->
              <xsl:if test="preceding-sibling::text()[preceding-sibling::case:courtcode and following-sibling::case:judges and parent::case:courtinfo]">
                <xsl:value-of select="ancestor::case:courtinfo/text()[preceding-sibling::case:courtcode and following-sibling::case:judges]"/>
              </xsl:if>
              <!--RS: 2018-01-04: Added below condition for moving text() of case:courtinfo under target element courtcase:judges Webstar number #7078814 -->
              <xsl:if test="normalize-space(preceding-sibling::text()[1]) = ':' and $streamID='AU01'">
                <xsl:value-of select="preceding-sibling::text()[1]"/>
              </xsl:if>
              <xsl:apply-templates select="@* | node()"/>
            </courtcase:judges>
          </courtcase:panel>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template case:judges[ancestor::case:content]
    Namespace No namespace
    Match case:judges[ancestor::case:content]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judges[ancestor::case:content]">
      <xsl:choose>
        <xsl:when test="@ln.user-displayed='false'"/>
        <xsl:otherwise>
          <courtcase:opinionby>
            <xsl:apply-templates select="@* | node()"/>
          </courtcase:opinionby>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template nl[parent::case:judges]
    Namespace No namespace
    Match nl[parent::case:judges]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="nl[parent::case:judges]"/>
    Template case:judge
    Namespace No namespace
    Match case:judge
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judge">
      <person:judge>
        <xsl:apply-templates select="@* | node()"/>
      </person:judge>
    </xsl:template>
    Template case:judges/emph[@typestyle='smcaps'][parent::case:judges]
    Namespace No namespace
    Match case:judges/emph[@typestyle='smcaps'][parent::case:judges]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judges/emph[@typestyle='smcaps'][parent::case:judges]">
      <xsl:apply-templates/>
    </xsl:template>
    Template case:judgmentbody[$streamID='CA01']
    Documentation

    Description

    case:judgmentbody becomes courtcase:opinion/bodytext.

    With the exception of heading, every child of case:judgmentbody should be mapped to courtcase:opinion/bodytext. case:judgmentbody/heading becomes courtcase:opinion/heading.

    Example: CA content

    <case:judgments>
      <case:judgment>
        <case:judgmentbody>
          <p>
            <text><emph typestyle="bf">MITCHELL, J.</emph> (for the Court, allowing the appeal): This
              case concerns the interpretation of municipal bylaws and the availability of injunctive
              relief to restrain their violation.</text>
          </p>
          ...
        </case:judgmentbody>
      </case:judgment>
    </case:judgments>
                
    becomes
    <courtcase:opinions>
      <courtcase:opinion>
        <bodytext>
          <p>
            <text><emph typestyle="bf">MITCHELL, J.</emph> (for the Court, allowing the appeal): This
              case concerns the interpretation of municipal bylaws and the availability of injunctive
              relief to restrain their violation.</text>
          </p>
          ...
        </bodytext>
      </courtcase:opinion>
    </courtcase:opinions>
        

    Example: AU content

    <case:judgmentbody>
      <pgrp>
        <heading><title>Background</title></heading>
        <p>
          <pnum count="1">[1]</pnum>
          <text>The present applicants are five individuals who at one time or another were engaged by
            Combined Insurance Company of America (Combined) as insurance agents. In recent times, the
            five have sued Combined in the Chief Industrial Magistrates&#x2019; Court of New South Wales
            claiming entitlements both to annual leave and long service leave. One of the principal
            issues to be resolved in those proceedings is the question of whether the agents were
            employees of Combined, as they contend, or rather independent contractors, as Combined
            contends. No doubt the resolution of that issue will involve a close consideration of a
            broad range of indicia. One of the matters to which Combined points is a term in its
            contract with each agent by which each agreed, or appears to have agreed, that his
            relationship with Combined was not one of employment.</text>
        </p>
      </pgrp>
      ...
    </case:judgmentbody>
                
    becomes
    <courtcase:opinion>
      <bodytext>
        <pgrp>
          <heading><title>Background</title></heading>
          <p>
            <desig value="1">[1]</desig>
            <text>The present applicants are five individuals who at one time or another were engaged by
              Combined Insurance Company of America (Combined) as insurance agents. In recent times, the
              five have sued Combined in the Chief Industrial Magistrates&#x2019; Court of New South
              Wales claiming entitlements both to annual leave and long service leave. One of the
              principal issues to be resolved in those proceedings is the question of whether the agents
              were employees of Combined, as they contend, or rather independent contractors, as
              Combined contends. No doubt the resolution of that issue will involve a close
              consideration of a broad range of indicia. One of the matters to which Combined points is
              a term in its contract with each agent by which each agreed, or appears to have agreed,
              that his relationship with Combined was not one of employment.</text>
          </p>
        </pgrp>
        ...
      </bodytext>
    </courtcase:opinion>
        

    Example: NZ content

    <case:judgmentbody>
      <p>
        <text>[After stating the facts, as above:] Section 127 (10) of the Act provides that no order
          for the removal of any wholesale licence shall be made without the prior approval of the
          Licensing Control Commission. On 22 March 1960 a formal order of the Licensing Control
          Commission approving the removal was issued by the Commission. The Licensing Committee did not
          itself hold any further meeting to consider the application made by Mrs Kettle for a removal
            <page count="37" reporter="NZLR" text="[1961] NZLR 35 page "/>of the licence to the
          Blackmore Street premises. On receipt of the approval by the Licensing Control Commission the
          chairman and clerk of the Licensing Committee completed the endorsement upon the licence
          required by s. 129 (2) of the Act. This was done on 31 March 1960. </text>
      </p>
      <p>
        <text>A few days later Mrs Kettle lodged applications for temporary and permanent transfers of
          the licence to Grogan and Blackmores Cordials Ltd. (the fourth defendant &#x2014; hereinafter
          referred to as &quot;Grogan and Blackmores&#x0022;). The temporary transfer was granted on 5
          April 1960. </text>
      </p>
    </case:judgmentbody>
                
    becomes
    <courtcase:opinion>
      <bodytext>
        <p>
          <text>[After stating the facts, as above:] Section 127 (10) of the Act provides that no order
            for the removal of any wholesale licence shall be made without the prior approval of the
            Licensing Control Commission. On 22 March 1960 a formal order of the Licensing Control
            Commission approving the removal was issued by the Commission. The Licensing Committee did
            not itself hold any further meeting to consider the application made by Mrs Kettle for a
            removal <ref:page num="37" page-scheme="NZLR" page-scheme-type="reporter-abbreviation"/> of
            the licence to the Blackmore Street premises. On receipt of the approval by the Licensing
            Control Commission the chairman and clerk of the Licensing Committee completed the
            endorsement upon the licence required by s. 129 (2) of the Act. This was done on 31 March
            1960. </text>
        </p>
        <p>
          <text>A few days later Mrs Kettle lodged applications for temporary and permanent transfers of
            the licence to Grogan and Blackmores Cordials Ltd. (the fourth defendant &#x2014;
            hereinafter referred to as &quot;Grogan and Blackmores&#x0022;). The temporary transfer was
            granted on 5 April 1960. </text>
        </p>
      </bodytext>
    </courtcase:opinion>
        

    Example: UK content

    <case:judgment>
      <case:judgmentbody>
        <pgrp>
          <p>
            <pnum>1</pnum>
          </p>
        </pgrp>
        <pgrp>
          <p>
            <text>&#x201c;The applicant had been in the employ of the respondent company from 31st
              August 1953, when he started as an apprentice, until his employment terminated on 4th May
              1972. Over that period of time Mr Middlemass had worked in all sorts of capacities for the
              company. However, the capacity about which we are concerned is that relating to either
              sales manager or technical representative on behalf of the company.</text>
          </p>
        </pgrp>
      </case:judgmentbody>
    </case:judgment>
                
    becomes
    <courtcase:opinion>
      <bodytext>
        <pgrp>
          <p>
            <desig>1</desig>
          </p>
        </pgrp>
        <pgrp>
          <p>
            <text>&#x201C;The applicant had been in the employ of the respondent company from 31st
              August 1953, when he started as an apprentice, until his employment terminated on 4th May
              1972. Over that period of time Mr Middlemass had worked in all sorts of capacities for the
              company. However, the capacity about which we are concerned is that relating to either
              sales manager or technical representative on behalf of the company.</text>
          </p>
        </pgrp>
      </bodytext>
    </courtcase:opinion>
        

    Description

     <topicref href="../../common_caselaw/Rosetta_case.judgmentbody-LxAdv_courtcase.opinion_bodytext.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.judgmentbody-LxAdv_courtcase.opinion_bodytext.dita  
     Vikas Rohilla : Template to match the case:judgmentbody   
    Namespace No namespace
    Match case:judgmentbody[$streamID='CA01']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="case:judgmentbody[$streamID='CA01']" priority="2">
      <xsl:apply-templates select="heading"/>
      <xsl:for-each-group select="child::*" group-starting-with="*[matches(.,':—|:--|:—')][string-length(substring-before(normalize-space(.),':—')) < 75 or (string-length(substring-before(normalize-space(.),':--')) < 75) or (string-length(substring-before(normalize-space(.),':—')) < 75)][self::p/pnum or self::p[@indent ='1st-line'] or self::l]">
        <xsl:variable name="opinionbytext" select="if(contains(.//text,':--')) then substring-before(.//text,':--') else if (contains(.,':—')) then substring-before(.//text,':—') else substring-before(.//text,':—')"/>
        <!--<xsl:variable name="opinionbytext" select="if(contains(.,':-\-')) then substring-before(.,':-\-') else if (contains(.,':&#x2014;')) then substring-before(.,':&#x2014;') else substring-before(.,':—')"/>-->
        <xsl:variable name="mdash">
          <xsl:for-each select=".">
            <xsl:value-of select="if (matches(.,':—|:--|:—') and ((string-length(substring-before(normalize-space(.),':—|:--|:—')) < 75) or (string-length(substring-before(normalize-space(.),':--')) < 75) or (string-length(substring-before(normalize-space(.),':—')) < 75))) then '1' else '0'"/>
          </xsl:for-each>
        </xsl:variable>
        <!--<xsl:if test="contains($mdash, '1')">
          <courtcase:opinionby>
            <person:judge>
              <xsl:variable name="judgetext">
                <xsl:analyze-string select="normalize-space($opinionbytext)" regex="([\[]?[0-9]+[\]]?)\s(.+)">
                  <xsl:matching-substring>
                    <xsl:value-of select="regex-group(2)"/>
                  </xsl:matching-substring>
                  <xsl:non-matching-substring>
                    <xsl:value-of select="."/>
                  </xsl:non-matching-substring>
                </xsl:analyze-string>
              </xsl:variable>
              <xsl:value-of select="normalize-space($judgetext)"/>
            </person:judge>
          </courtcase:opinionby>
          </xsl:if>-->
        <!--  <xsl:choose>
            <xsl:when test="current-group()[1][self::l] and ($mdash =1)">
              <bodytext>
                <xsl:apply-templates select="current-group()[position() != 1]"/>
              </bodytext>
            </xsl:when>
            <xsl:otherwise>
              <bodytext>
                <xsl:apply-templates select="current-group()"/>
              </bodytext>
            </xsl:otherwise>
            
          </xsl:choose> -->
        <xsl:if test="position() =1 and ($mdash = 1)">
          <courtcase:opinion>
            <xsl:if test="contains($mdash, '1')">
              <courtcase:opinionby>
                <person:judge>
                  <xsl:variable name="judgetext">
                    <xsl:analyze-string select="normalize-space($opinionbytext)" regex="([\[]?[0-9]+[\]]?)\s(.+)">
                      <xsl:matching-substring>
                        <xsl:value-of select="regex-group(2)"/>
                      </xsl:matching-substring>
                      <xsl:non-matching-substring>
                        <xsl:value-of select="."/>
                      </xsl:non-matching-substring>
                    </xsl:analyze-string>
                  </xsl:variable>
                  <xsl:value-of select="normalize-space($judgetext)"/>
                </person:judge>
              </courtcase:opinionby>
            </xsl:if>
            <xsl:choose>
              <xsl:when test="current-group()[1][self::l] and ($mdash =1)">
                <bodytext>
                  <xsl:apply-templates select="current-group()[position() != 1]"/>
                </bodytext>
              </xsl:when>
              <xsl:otherwise>
                <bodytext>
                  <xsl:apply-templates select="current-group()"/>
                </bodytext>
              </xsl:otherwise>
            </xsl:choose>
          </courtcase:opinion>
        </xsl:if>
        <!-- <xsl:if test="$mdash = 0">
            <courtcase:opinion>
              <bodytext>
                <xsl:apply-templates select="current-group()"/>
              </bodytext>
            </courtcase:opinion>
          </xsl:if>-->
        <xsl:if test="position() !=1">
          <courtcase:opinion>
            <xsl:if test="position() = 2 and not(matches(preceding-sibling::*[1], ':—|:--|:—'))">
              <bodytext>
                <xsl:apply-templates select="./preceding-sibling::node()"/>
              </bodytext>
            </xsl:if>
            <xsl:if test="contains($mdash, '1')">
              <courtcase:opinionby>
                <person:judge>
                  <xsl:variable name="judgetext">
                    <!--<xsl:analyze-string select="normalize-space($opinionbytext)" regex="(^[0-9]+)([^>]+)">-->
                    <xsl:analyze-string select="normalize-space($opinionbytext)" regex="([\[]?[0-9]+[\]]?)\s(.+)">
                      <xsl:matching-substring>
                        <xsl:value-of select="regex-group(2)"/>
                      </xsl:matching-substring>
                      <xsl:non-matching-substring>
                        <xsl:value-of select="."/>
                      </xsl:non-matching-substring>
                    </xsl:analyze-string>
                  </xsl:variable>
                  <xsl:value-of select="normalize-space($judgetext)"/>
                </person:judge>
              </courtcase:opinionby>
            </xsl:if>
            <xsl:choose>
              <xsl:when test="current-group()[1][self::l] and ($mdash =1)">
                <bodytext>
                  <xsl:apply-templates select="current-group()[position() != 1]"/>
                </bodytext>
              </xsl:when>
              <xsl:otherwise>
                <bodytext>
                  <xsl:apply-templates select="current-group()"/>
                </bodytext>
              </xsl:otherwise>
            </xsl:choose>
          </courtcase:opinion>
        </xsl:if>
      </xsl:for-each-group>
      <xsl:apply-templates select="parent::case:judgement/following-sibling::case:appendix/p|               parent::case:judgement/following-sibling::case:appendix/case:headnote/case:priorhist[not(preceding-sibling::case:info or following-sibling::case:info)]"/>
      <!--<xsl:element name="bodytext">
    
          <xsl:apply-templates select="@* | node() except heading"/>
          
          <xsl:apply-templates select="parent::case:judgement/following-sibling::case:appendix/p|        
                                       parent::case:judgement/following-sibling::case:appendix/case:headnote/case:priorhist[not(preceding-sibling::case:info or following-sibling::case:info)]"/>
        </xsl:element>-->
    </xsl:template>
    Template case:judgmentbody
    Namespace No namespace
    Match case:judgmentbody
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judgmentbody">
      <!-- Awantika: added instruction for heading -->
      <xsl:apply-templates select="heading"/>
      <xsl:element name="bodytext">
        <xsl:apply-templates select="@* | node() except heading"/>
      </xsl:element>
    </xsl:template>
    Template case:constituents
    Documentation

    Description

    case:constituents becomes courtcase:opinions/courtcase:representation with child elements handled as described below.

    Note: There can be multiple case:constituents elements at different locations in a file (generally before and after the case:judgment). These elements need to be maintained in the same locations. The general rule remains that the content order should be maintained from input to output.

    case:constituent becomes courtcase:opinions/courtcase:representation/courtcase:counsel.

    Note: If person occurs inside case:constituent, kindly refer to the instructions for person in the General Markup section for guidance on handling of this scenario.

    Example: AU content

    <case:constituents>
        <case:constituent>
            <emph typestyle="it">A Leopold SC</emph> and 
            <emph typestyle="it">T Saunders</emph> instructed by 
            <emph typestyle="it">Allens Arthur Robinson</emph> for the applicant (Combined Insurance Company of America t/as Combined Insurance Company of Australia).
        </case:constituent>
    </case:constituents>
               
    becomes
    <courtcase:representation>
        <courtcase:counsel>
            <emph typestyle="it">A Leopold SC</emph> and 
            <emph typestyle="it">T Saunders</emph> instructed by 
            <emph typestyle="it">Allens Arthur Robinson</emph> for the applicant (Combined Insurance Company of America t/as Combined Insurance Company of Australia).
        </courtcase:counsel>
    </courtcase:representation>
               

    Example: NZ content

    <case:constituents>
        <case:constituent constituenttype="counsel">J. K. Patterson, for the plaintiffs.</case:constituent>
        <case:constituent constituenttype="counsel">Tucker, for the first defendant.</case:constituent>
        <case:constituent constituenttype="counsel">R. E. Wylie, for the second, third and fourth defendants.</case:constituent>
    </case:constituents>
               
    becomes
    <courtcase:representation>
        <courtcase:counsel>J. K. Patterson, for the plaintiffs.</courtcase:counsel>
        <courtcase:counsel>Tucker, for the first defendant.</courtcase:counsel>
        <courtcase:counsel>R. E. Wylie, for the second, third and fourth defendants.</courtcase:counsel>
    </courtcase:representation>
               

    Example: UK content

    <case:constituents>
        <case:constituent>
            <person>
                <name.text>P Shepherd for the Appellant</name.text>
            </person>
        </case:constituent>
        <case:constituent>
            <person>
                <name.text>R Wood for the Respondents</name.text>
            </person>
        </case:constituent>
        <case:constituent>
            <person>
                <name.text>Clyde &amp; Co; Hill Dickinson</name.text>
            </person>
        </case:constituent>
    </case:constituents>
               
    becomes
    <courtcase:opinions>
        <courtcase:representation>
            <courtcase:counsel>
                <person:counselor>
                    <person:person>
                        <person:name.text>
                            P Shepherd for the Appellant
                        </person:name.text>
                    </person:person>
                </person:counselor>
            </courtcase:counsel>
            <courtcase:counsel>
                <person:counselor>
                    <person:person>
                        <person:name.text>
                            R Wood for the Respondents
                        </person:name.text>
                    </person:person>
                </person:counselor>
            </courtcase:counsel>
            <courtcase:counsel>
                <person:counselor>
                    <person:person>
                        <person:name.text>
                            Clyde &#x0026; Co; Hill Dickinson
                        </person:name.text>
                    </person:person>
                </person:counselor>
            </courtcase:counsel>
        </courtcase:representation>
    </courtcase:opinions>
               

    Any other elements under case:constituents should be placed under courtcase:opinions/courtcase:representation/courtcase:arguments/bodytext. For example,

    • case:constituents/p becomes courtcase:representation/courtcase:arguments/bodytext/p.
    • case:constituents/pgrp becomes courtcase:opinions/courtcase:representation/courtcase:arguments/bodytext/pgrp.

    Example: AU content

    <case:constituents>
        <p>
            <text>Solicitors: Anderssen Lawyers for the Appellants; McInnes Wilson Lawyers for the Respondent; King &amp; Co Solicitors for the Second to Twelfth Respondents.  MGMW</text>
        </p>
    </case:constituents>
               
    becomes
    <courtcase:representation>
        <courtcase:arguments>
            <bodytext>
                <p>
                    <text>Solicitors: Anderssen Lawyers for the Appellants; McInnes Wilson Lawyers for the Respondent; King &amp; Co Solicitors for the Second to Twelfth Respondents.  MGMW</text>
                </p>
            </bodytext>
        </courtcase:arguments>
    </courtcase:representation>
               

    Example: UK content

    <case:constituents>
        <pgrp>
            <p>
                <text>The course of business was, to the knowledge of all the directors,
                    to supply agents with laudatory prospectuses and other documents,
                    mostly prepared by <emph typestyle="it">Feigan</emph>, to be used
                    for the purpose of inducing persons to take shares, and it is no
                    defence for a director to say that he allowed this to go on without
                    examining the papers to see whether they were honest or
                    fraudulent.</text>
            </p>
            <p>
                <text>In <emph typestyle="it">Peek v. Gurney</emph> the House of Lords,
                    though they held that the bill must be dismissed because the
                    Plaintiff was not an original allottee of shares, yet expressed an
                    opinion that <emph typestyle="it">Barclay</emph>, one of the
                    directors of <emph typestyle="it">Overend, Gurney, &amp; Co</emph>.,
                    was liable for the misrepresentations contained in a prospectus, in
                    the preparation and issuing of which he had taken no part, and which
                    he had never read. As against the company the Plaintiff is entitled,
                    upon the pleadings as they stand, to claim rescission of the
                    contract to take shares. But, if necessary, we ask leave to
                    amend</text>
            </p>
            <footnotegrp>
                <footnote fntoken="0">
                    <fnbody>
                        <p>
                            <text>(1)     Law Rep. 6 H. L. 377.</text>
                        </p>
                    </fnbody>
                </footnote>
                ...
            </footnotegrp>
            ...
        </pgrp>
    </case:constituents>
               
    becomes
    <courtcase:opinions>
        <courtcase:representation>
            <courtcase:arguments>
                <bodytext>
                    <pgrp>
                        <p>
                            <text>The course of business was, to the knowledge of all the directors,
                                to supply agents with laudatory prospectuses and other documents,
                                mostly prepared by <emph typestyle="it">Feigan</emph>, to be used
                                for the purpose of inducing persons to take shares, and it is no
                                defence for a director to say that he allowed this to go on without
                                examining the papers to see whether they were honest or
                                fraudulent.</text>
                        </p>
                        <p>
                            <text>In <emph typestyle="it">Peek v. Gurney</emph> the House of Lords,
                                though they held that the bill must be dismissed because the
                                Plaintiff was not an original allottee of shares, yet expressed an
                                opinion that <emph typestyle="it">Barclay</emph>, one of the
                                directors of <emph typestyle="it">Overend, Gurney, &#x0026; Co</emph>.,
                                was liable for the misrepresentations contained in a prospectus, in
                                the preparation and issuing of which he had taken no part, and which
                                he had never read. As against the company the Plaintiff is entitled,
                                upon the pleadings as they stand, to claim rescission of the
                                contract to take shares. But, if necessary, we ask leave to
                                amend</text>
                        </p>
                        <p>
                            <text>
                                <footnotegroup>
                                    <footnote>
                                        <ref:anchor id="_1234"/>
                                        <bodytext>
                                            <p>
                                                <text>(1)     Law Rep. 6 H. L. 377.</text>
                                            </p>
                                        </bodytext>
                                    </footnote>
                                    ...
                                </footnotegroup>
                            </text>
                        </p>        
                        ...
                    </pgrp>
                </bodytext>
            </courtcase:arguments>
        </courtcase:representation>
    </courtcase:opinions>
               

    Description

     <topicref href="../../common_caselaw/Rosetta_case.constituents-LxAdv_courtcase.opinions_courtcase.representation.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_case.constituents-LxAdv_courtcase.opinions_courtcase.representation.dita  
      Original Target XPath:  courtcase:opinions/courtcase:representation   
    Namespace No namespace
    Match case:constituents
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:constituents">
      <courtcase:representation>
        <xsl:for-each select="child::*">
          <xsl:choose>
            <xsl:when test="self::case:constituent">
              <xsl:apply-templates select="."/>
            </xsl:when>
            <xsl:otherwise>
              <courtcase:arguments>
                <bodytext>
                  <xsl:apply-templates select="."/>
                </bodytext>
              </courtcase:arguments>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each>
      </courtcase:representation>
    </xsl:template>
    Template heading[parent::case:constituents]
    Documentation

    Description

    heading not allowed within bodytext; map to h

    Namespace No namespace
    Match heading[parent::case:constituents]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="heading[parent::case:constituents]">
      <h>
        <xsl:apply-templates select="@* | node()"/>
      </h>
    </xsl:template>
    Template title[not( normalize-space( . ) = '' ) and parent::heading/parent::case:constituents]
    Documentation

    Description

    Output the children of title within the 'h' created above.

    Namespace No namespace
    Match title[not( normalize-space( . ) = '' ) and parent::heading/parent::case:constituents]
    Mode #default
    Import precedence 0
    Priority 1
    Source
    <xsl:template match="title[not( normalize-space( . ) = '' ) and parent::heading/parent::case:constituents]" priority="1">
      <xsl:apply-templates/>
    </xsl:template>
    Template case:constituent
    Namespace No namespace
    Match case:constituent
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:constituent">
      <!--  Original Target XPath:  courtcase:opinions/courtcase:representation/courtcase:counsel   -->
      <!--<xsl:choose>
    		    <xsl:when test="child::person">		       
    		        <courtcase:counsel>
    		        	<!-\- JD: 2017-06-16: removing <person:counselor> wrapper, added by Rosetta_case.constituent_person-LxAdv-person.counselor_person.person.xsl -\->
    		            <!-\-<person:counselor>-\->
    		                <xsl:apply-templates select="@* | node()"/>
    		            <!-\-</person:counselor>-\->		            
    		        </courtcase:counsel>
    		    </xsl:when>
    		    <xsl:otherwise>-->
      <courtcase:counsel>
        <xsl:apply-templates select="@* except @constituenttype | node()"/>
      </courtcase:counsel>
      <!--</xsl:otherwise>
    		</xsl:choose>-->
    </xsl:template>
    Template case:filenum
    Documentation

    Description

    <case:courtinfo>
        ...
        <case:filenum>N2003/810</case:filenum>
        ...
    </case:courtinfo>
           
    becomes
    <caseinfo:caseinfo>
        ...
        <caseinfo:docketnum>N2003/810</caseinfo:docketnum>
        ...
    </caseinfo:caseinfo>
           

    Description

     <xsl:template match="case:constituents[child::p | child::pgrp]">
           <!-\- <courtcase:opinions>-\->
            <courtcase:representation>
    	        <courtcase:arguments>
    	            <bodytext>
    	                <xsl:apply-templates select="@* | node()"/>
    	            </bodytext>
    	        </courtcase:arguments>
            </courtcase:representation>
            <!-\-</courtcase:opinions>-\->
        </xsl:template>
    <xsl:template match="case:judgment">
            
    		<!-\-  Original Target XPath:  courtcase:opinions/courtcase:representation/courtcase:counsel   -\->
    		<courtcase:opinions>
    			<courtcase:representation>
    				<courtcase:counsel>
    					<xsl:apply-templates select="@* | node()"/>
    				</courtcase:counsel>
    			</courtcase:representation>
    		</courtcase:opinions>
    		
    	</xsl:template>
    	<xsl:template match="person">
    
    		<!-\-  Original Target XPath:  courtcase:opinions/courtcase:representation/courtcase:arguments/bodytext   -\->
    		<courtcase:opinions>
    			<courtcase:representation>
    				<courtcase:arguments>
    					<bodytext>
    						<xsl:apply-templates select="@* | node()"/>
    					</bodytext>
    				</courtcase:arguments>
    			</courtcase:representation>
    		</courtcase:opinions>
    
    	</xsl:template>
    <xsl:template match="case:constituents/p">
    
    		<!-\-  Original Target XPath:  courtcase:representation/courtcase:arguments/bodytext/p   -\->
    		<courtcase:representation>
    			<courtcase:arguments>
    				<bodytext>
    					<p>
    						<xsl:apply-templates select="@* | node()"/>
    					</p>
    				</bodytext>
    			</courtcase:arguments>
    		</courtcase:representation>
    
    	</xsl:template>
    
    	<xsl:template match="case:constituents/pgrp">
    
    		<!-\-  Original Target XPath:  courtcase:opinions/courtcase:representation/courtcase:arguments/bodytext/pgrp   -\->
    		<courtcase:opinions>
    			<courtcase:representation>
    				<courtcase:arguments>
    					<bodytext>
    						<pgrp>
    							<xsl:apply-templates select="@* | node()"/>
    						</pgrp>
    					</bodytext>
    				</courtcase:arguments>
    			</courtcase:representation>
    		</courtcase:opinions>
    
    	</xsl:template>
     <topicref href="AU01_Rosetta_case.filenum-LxAdv_caseinfo.docketnum.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.filenum-LxAdv_caseinfo.docketnum.dita  
    <xsl:message>AU01_Rosetta_case.filenum-LxAdv_caseinfo.docketnum.xsl requires manual development!</xsl:message>
    SS: Done "AU01_Rosetta_case.filenum-LxAdv_caseinfo.docketnum"
    Namespace No namespace
    Match case:filenum
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:filenum">
      <caseinfo:docketnum>
        <xsl:apply-templates select="@* | node()"/>
      </caseinfo:docketnum>
    </xsl:template>
    Template prelim
    Documentation

    Description

    prelim becomes courtcase:prelim.

    All children of prelim should be mapped to children of courtcase:prelim/bodytext.

    Example: AU content

    <case:judgments>
        ...
        <prelim>
            <p>
                <text align="right"><emph typestyle="it">Cur adv vult</emph></text>
            </p>
        </prelim>
        ...
    </case:judgments>
                
    becomes
    <courtcase:opinions>
        ...
        <courtcase:prelim>
            <bodytext>
                <p>
                    <text align="right"><emph typestyle="it">Cur adv vult</emph></text>
                </p>
            <bodytext>
        </courtcase:prelim>
        ...
    </courtcase:opinions>
        

    Example: UK content

    <prelim>
        <pgrp>
            <p>
                <text>3. The factual background to the three claims is set out in
                    [17]&#x2013;[29], below. The issues raised on this application are
                    described in detail in [30], below. The admissibility and value of
                    statements contained in witness statements made by officials is
                    considered in [32]&#x2013;[36], below. The admissibility and
                    significance of the report of the Parliamentary Joint Committee on
                    Human Rights on the new regime is discussed in [37], below.
                    Paragraphs [38] and [39], below, explain why it is the current
                    effect of the new regime which has to be considered rather than when
                    it was enacted.</text>
            </p>
        </pgrp>
    </prelim>
                
    becomes
    <courtcase:prelim>
        <bodytext>
            <pgrp>
                <p>
                    <text>3. The factual background to the three claims is set out in
                        [17]&#x2013;[29], below. The issues raised on this application are
                        described in detail in [30], below. The admissibility and value of
                        statements contained in witness statements made by officials is
                        considered in [32]&#x2013;[36], below. The admissibility and
                        significance of the report of the Parliamentary Joint Committee on
                        Human Rights on the new regime is discussed in [37], below.
                        Paragraphs [38] and [39], below, explain why it is the current
                        effect of the new regime which has to be considered rather than when
                        it was enacted.</text>
                </p>
            </pgrp>
        </bodytext>
    </courtcase:prelim>
        

    Description

     <topicref href="../../common_caselaw/Rosetta_prelim-LxAdv_courtcase.prelim.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_caselaw\Rosetta_prelim-LxAdv_courtcase.prelim.dita  
    Namespace No namespace
    Match prelim
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="prelim">
      <!--  Original Target XPath:  courtcase:prelim   -->
      <courtcase:prelim>
        <bodytext>
          <xsl:apply-templates select="@* | node()"/>
        </bodytext>
      </courtcase:prelim>
    </xsl:template>
    Template case:order
    Documentation

    Description

    <case:order subdoc="true" toc-caption="Orders">
        <heading>
            <title>Orders</title>
        </heading>
        <l>
            <li>
                <lilabel><emph typestyle="ro">(1)</emph></lilabel>
                <p>
                    <text>The plaintiffs&#x2019; application is dismissed.</text>
                </p>
            </li>
            <li>
                <lilabel><emph typestyle="ro">(2)</emph></lilabel>
                <p>
                    <text>The plaintiffs pay the defendant&#x2019;s costs, including each appearance in the court, as taxed, if not agreed.</text>
                </p>
            </li>
        </l>
    </case:order>
           
    becomes
    <courtcase:orders>
        <courtcase:order includeintoc="true" alternatetoccaption="Orders">
            <heading>
                <title>Orders</title>
            </heading>
            <bodytext>
                <list>
                    <listitem>
                        <label><emph typestyle="ro">(1)</emph></label>
                        <bodytext>
                            <p>
                                <text>The plaintiffs&#x2019; application is dismissed.</text>
                            </p>
                        </bodytext>
                    </listitem>
                    <listitem>
                        <label><emph typestyle="ro">(2)</emph></label>
                        <bodytext>
                            <p>
                                <text>The plaintiffs pay the defendant&#x2019;s costs, including each appearance in the court, as taxed, if not agreed.</text>
                            </p>
                        </bodytext>
                    </listitem>
                </list>
            </bodytext>    
        </courtcase:order>
    </courtcase:orders>
           

    Description

     <topicref href="AU01_Rosetta_case.order-LxAdv_courtcase.order.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.order-LxAdv_courtcase.order.dita  
    <xsl:message>AU01_Rosetta_case.order-LxAdv_courtcase.order.xsl requires manual development!</xsl:message>
     SS: Done - Added instruction for case:order 
    Namespace No namespace
    Match case:order
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:order">
      <courtcase:orders>
        <courtcase:order>
          <xsl:choose>
            <xsl:when test="./@subdoc">
              <xsl:attribute name="includeintoc">
                <xsl:value-of select="@subdoc"/>
              </xsl:attribute>
            </xsl:when>
            <xsl:when test="./@toc-caption">
              <xsl:attribute name="alternatetoccaption">
                <xsl:value-of select="@toc-caption"/>
              </xsl:attribute>
            </xsl:when>
          </xsl:choose>
          <xsl:apply-templates select="heading"/>
          <bodytext>
            <xsl:apply-templates select="@* | node() except heading"/>
          </bodytext>
        </courtcase:order>
      </courtcase:orders>
    </xsl:template>
    Template case:appendix
    Documentation

    Description

    <case:judgments>
        ...
        <case:appendix>
            <p>
                <text>Attached is a copy of the relevant portion of the judgment of the Supreme<nl/>Court Equity Division in 
                    <ci:cite searchtype="CASE-REF">
                        <ci:content>
                            <citefragment searchtype="CASE-NAME-REF"><emph typestyle="it">Massoud v NRMA Insurance Ltd</emph></citefragment>
                        </ci:content>
                    </ci:cite> referred to at 655
                    <ci:cite searchtype="CASE-REF">
                        <ci:case>
                            <ci:caseinfo>
                                <ci:decisiondate year="2005"/>
                            </ci:caseinfo>
                            <ci:caseref ID="cr002">
                                <ci:reporter value="nswlr"/>
                                <ci:volume num="62"/>
                                <ci:page num="653"/>
                            </ci:caseref>
                            <ci:caseref anaphref="cr002" spanref="cr002-01">
                                <ci:pinpoint targettype="para" num="7"/>
                            </ci:caseref>
                        </ci:case>
                        <ci:content>
                            <citefragment searchtype="CASE-CITE-REF">
                                <ci:span spanid="cr002-01">[7]</ci:span>
                            </citefragment>
                        </ci:content>
                    </ci:cite>.
                </text>
            </p>
        </case:appendix>
    </case:judgments>
               
    becomes
    <courtcase:opinions>
        ...
        <attachments>
            <appendix>
                <bodytext>
                    <p>
                        <text>Attached is a copy of the relevant portion of the judgment of the Supreme<proc:nl/>Court Equity Division in 
                            <lnci:cite type="case">
                                <lnci:content>
                                    <emph typestyle="it">Massoud v NRMA Insurance Ltd</emph>
                                </lnci:content>
                            </lnci:cite> referred to at 655
                            <lnci:cite>
                                <lnci:case>
                                    <lnci:caseinfo>
                                        <lnci:decisiondate year="2005"/>
                                    </lnci:caseinfo>
                                    <lnci:caseref ID="cr002">
                                        <lnci:reporter value="nswlr"/>
                                        <lnci:volume num="62"/>
                                        <lnci:page num="653"/>
                                    </lnci:caseref>
                                    <lnci:caseref anaphref="cr002">
                                        <lnci:pinpoint targettype="para" num="7"/>
                                    </lnci:caseref>
                                </lnci:case>
                                <lnci:content>[7]</lnci:content>
                            </lnci:cite>.
                        </text>
                    </p>
                </bodytext>
            </appendix>
        </attachments>
    </courtcase:opinions>
               

    If case:embeddedcase occurs within case:appendix then conversion need to handle courtcase:caseexcerpt by using bodytext under appendix i.e, case:appendix/case:embeddedcase becomes attachments/appendix/bodytext/courtcase:caseexcerpt

    <case:appendix>
        <case:embeddedcase id="1980_QD_R_411">
            <case:content>
                <case:judgments>
                    <case:judgment subdoc="true" toc-caption="Judgment 1">
                        <case:judgmentbody>
                            <p>
                                <text>This was an action...</text>
                            </p>
                        </case:judgmentbody>
                    </case:judgment>
                </case:judgments>
            </case:content>
        </case:embeddedcase>
    </case:appendix>
               
    becomes
    <attachments>
        <appendix>
            <bodytext>
                <courtcase:caseexcerpt xml:id="_1980_QD_R_411">
                    <courtcase:body>
                        <courtcase:opinions>
                            <courtcase:opinion includeintoc="true" alternatetoccaption="Judgment 1">
                                <bodytext>
                                    <p>
                                        <text>This was an action...</text>
                                    </p>
                                </bodytext>
                            </courtcase:opinion>
                        </courtcase:opinions>
                    </courtcase:body>    
                </courtcase:caseexcerpt>
            </bodytext>
        </appendix>
    </attachments>
               

    When sigblock is a child of case:appendix then case:appendix/sigblock/p/text/person/name.text becomes attachments/appendix/bodytext/note/byline/person:person/person:name.text.

    <case:appendix>
        <sigblock>
            <p>
                <text>
                    <person>
                        <name.text>David Ritter</name.text>
                    </person>
                </text>
            </p>
        </sigblock>
    </case:appendix>
               
    becomes
    <attachments>
        <appendix>
            <bodytext>
                <note>
                    <byline>
                        <person:person>
                            <person:name.text>David Ritter</person:name.text>
                        </person:person>
                    </byline>
                </note>
            </bodytext>
        </appendix>
    </attachments>
               

    Changes Specific to AU01

    2013-11-12: Added Instruction and example when sigblock is a child of case:appendix: Webstar #: 5093906. This change immediately applies to AU01 Caselaw.

    2012-08-23: Modified example to use an underscore instead of the two digit country code for xml:id.


    Description

     <topicref href="AU01_Rosetta_case.appendix-LxAdv_attachments_appendix.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.appendix-LxAdv_attachments_appendix.dita 
     SS: Done - case:appendix 
     <xsl:template match="case:appendix">
            <attachments>
                <appendix> 
                    <xsl:if test="child::heading">
                        <xsl:apply-templates select="heading"/>                   
                    </xsl:if>
                    <xsl:if test="node() except heading">
                        <bodytext>
                            <xsl:if test="child::case:appendix">
                                <xsl:apply-templates select="case:embeddedcase"/>
                            </xsl:if>
                            <xsl:apply-templates select="@* | node() except heading"/>
                        </bodytext>
                    </xsl:if>
                </appendix>
            </attachments>
        </xsl:template>
     Awantika: Updated template for embededcase and sigblock 
    Namespace No namespace
    Match case:appendix
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:appendix">
      <attachments>
        <appendix>
          <xsl:if test="child::heading">
            <xsl:apply-templates select="heading"/>
          </xsl:if>
          <xsl:if test="node() except heading">
            <bodytext>
              <xsl:if test="child::case:embeddedcase">
                <xsl:apply-templates select="case:appendix/case:embeddedcase"/>
              </xsl:if>
              <xsl:if test="child::sigblock">
                <note>
                  <byline>
                    <xsl:apply-templates select="descendant::person"/>
                  </byline>
                </note>
              </xsl:if>
              <xsl:apply-templates select="@* | node() except heading except sigblock except case:embeddedcase"/>
            </bodytext>
          </xsl:if>
        </appendix>
      </attachments>
    </xsl:template>
    Template case:author
    Documentation

    Description

    <case:author>
        <person>
            <name.text>SAM ROSEWARNE</name.text><role>BARRISTER</role>
        </person>
    </case:author>
               
    becomes
    <courtcase:body>
        <note>
            <byline>
                <person:contributor contributor-type="author">
                    <person:person>
                        <person:name.text>SAM ROSEWARNE</person:name.text>
                        <role>BARRISTER</role>
                    </person:person>
                </person:contributor>
            </byline>
        </note>
    </courtcase:body>
               

    Description

    <xsl:template match="case:appendix[not(child::case:embeddedcase or child::sigblock)]">
    		<attachments>
    			<appendix>
    				<xsl:apply-templates/>
    			</appendix>
    		</attachments>
    	</xsl:template>
    
    	<xsl:template match="case:appendix[child::case:embeddedcase]">
    		<attachments>
    			<appendix>
    				<bodytext>
    					<xsl:apply-templates select="@* | node()"/>
    				</bodytext>
    			</appendix>
    		</attachments>
    	</xsl:template>
    
    
    	<xsl:template match="case:appendix[child::sigblock]">
    		<attachments>
    			<appendix>
    				<bodytext>
    					<note>
    						<byline>
    							<person:person xmlns:person="http://www.lexisnexis.com/xmlschemas/content/shared/person/1/">
    								<person:name.text>
    									<xsl:apply-templates select="@* | node()"/>
    								</person:name.text>
    							</person:person>
    						</byline>
    					</note>
    				</bodytext>
    			</appendix>
    		</attachments>
    	</xsl:template>
     <topicref href="AU01_Rosetta_case.author-LxAdv_courtcase.body_note_byline.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\DITA-PAC\AU01_CaseLaw\AU01_Rosetta_case.author-LxAdv_courtcase.body_note_byline.dita  
    <xsl:message>AU01_Rosetta_case.author-LxAdv_courtcase.body_note_byline.xsl requires manual development!</xsl:message>
    SS: Done - case:author
    Namespace No namespace
    Match case:author
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:author">
      <note>
        <byline>
          <xsl:apply-templates select="@* | node()"/>
        </byline>
      </note>
    </xsl:template>
    Template desig
    Documentation

    Description

    Applicable only on AU01, AU13, NZ03, CA01, CA04 and CA10.

    When source document is having desig then desig becomes desig/ref:para.

    Value of desig@value becomes both desig@value and desig/ref:para@num.

    Value of ref:para/@para-scheme is ci:reporter value from ( first ) ci:cite/[@type=”cite4thisdoc”]/ci:case/ci:caseref/ci:reporter.

    ref:para/@para-scheme-type="reporter-abbrev" is hardcoded value.

    <p>
        <desig value="5">5</desig>
        <text>...</text>
    </p>
    
    and
    
    <case:reportercite>
        <ci:cite type="cite4thisdoc">
            <ci:case>
                <ci:caseinfo>
                    <ci:decisiondate year="1974" />
                </ci:caseinfo>
                <ci:caseref>
                    <ci:reporter value="IPR" />
                    <ci:volume num="1a"></ci:volume>
                    <ci:edition>
                        <ci:date year="1974" />
                    </ci:edition>
                    <ci:page num="511" />
                </ci:caseref>
            </ci:case>
            <ci:content>
                <citefragment searchtype="CASE-CITE-REF">(1974) 1a IPR 511</citefragment>
            </ci:content>
        </ci:cite>
    </case:reportercite>
    
    Becomes
    
    <p>
        <desig value="5"><ref:para num="5" para-scheme="IPR" para-scheme-type="reporter-abbrev">5</ref:para></desig>
        <text>...</text>
    </p>
    

    Description

     <topicref href="../../common_newest/Rosetta_desig-LxAdv-desig_ref.para.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_desig-LxAdv-desig_ref.para.dita  
    Namespace No namespace
    Match desig
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="desig">
      <!--  Original Target XPath:  desig/ref:para   -->
      <xsl:choose>
        <xsl:when test="$streamID=('AU01', 'NZ03', 'CA01','CA04')">
          <desig>
            <xsl:attribute name="value">
              <xsl:value-of select="@value"/>
            </xsl:attribute>
            <ref:para>
              <xsl:attribute name="num">
                <xsl:value-of select="@value"/>
              </xsl:attribute>
              <xsl:attribute name="para-scheme">
                <xsl:value-of select="(//ci:cite/ci:case/ci:caseref/ci:reporter/@value)[1]"/>
              </xsl:attribute>
              <xsl:attribute name="para-scheme-type">
                <xsl:text>reporter-abbrev</xsl:text>
              </xsl:attribute>
              <xsl:apply-templates select="@* | node()"/>
            </ref:para>
            <!-- Awantika: Duplicate ref:para if case:courtcite/ci:cite/@type="cite4thisdoc" in AU01 -->
            <xsl:if test="$streamID='AU01' and //case:courtcite[ci:cite[@type='cite4thisdoc']]">
              <ref:para>
                <xsl:attribute name="num">
                  <xsl:value-of select="@value"/>
                </xsl:attribute>
                <xsl:attribute name="para-scheme">
                  <xsl:value-of select="(//ci:au/@courtcode)[1]"/>
                </xsl:attribute>
                <xsl:attribute name="para-scheme-type">
                  <xsl:text>reporter-abbrev</xsl:text>
                </xsl:attribute>
              </ref:para>
            </xsl:if>
          </desig>
        </xsl:when>
        <xsl:when test="$streamID=('AU13','HK09')">
          <xsl:choose>
            <xsl:when test="parent::heading[parent::case:body]">
              <desig>
                <xsl:value-of select="."/>
              </desig>
            </xsl:when>
            <xsl:otherwise>
              <desig>
                <xsl:attribute name="value">
                  <xsl:value-of select="@value"/>
                </xsl:attribute>
                <ref:para>
                  <xsl:attribute name="num">
                    <xsl:value-of select="@value"/>
                  </xsl:attribute>
                  <xsl:attribute name="para-scheme">
                    <xsl:value-of select="(//ci:cite/ci:case/ci:caseref/ci:reporter/@value)[1]"/>
                  </xsl:attribute>
                  <xsl:attribute name="para-scheme-type">
                    <xsl:text>reporter-abbrev</xsl:text>
                  </xsl:attribute>
                  <xsl:apply-templates select="@* | node()"/>
                </ref:para>
              </desig>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
      </xsl:choose>
    </xsl:template>
    Template docinfo
    Documentation

    Description

    Instructions [common element]

    • docinfo becomes doc:metadata/doc:docinfo. docinfo:dpsi[@id-string], docinfo[@browseprev], docinfo[@browsenext], docinfo[@partitionnum], docinfo[@majorrevision], and docinfo[@excludefromalerts] become doc:metadata/doc:docinfo/doc:legacy-metadata with attribute doc:legacy-metadata[@metadatasource="lbu-meta"] with child elements:
      • Create meta and metaitem with attributes @name and @value.
      • If document also contains an element docinfo:lbu-meta with child elements that are not explicitly dropped, include each metaitem after all of the docinfo attributes are placed here. See Example docinfo and docinfo:lbu-meta below.

    Source XML

     <docinfo partitionnum="2"> <docinfo:dpsi id-string="006F"> .................
    					................. </docinfo> 

    Target XML

     <doc:metadata> <doc:docinfo doc-content-country="AU"> <dc:metadata> ...... ......
    					</dc:metadata> <doc:legacy-metadata metadatasource="lbu-meta"> <meta> <metaitem
    					name="partitionnum" value="2"/> <metaitem name="dpsi" value="006F"/> </meta>
    					</doc:legacy-metadata> </doc:docinfo> </doc:metadata> 

    Source XML

     <docinfo browseprev="true" browsenext="true" majorrevision="false" excludefromalerts="true">
    					................. ................. </docinfo> 

    Target XML

     <doc:metadata> <doc:docinfo doc-content-country="AU"> <dc:metadata> ...... ......
    					</dc:metadata> <doc:legacy-metadata metadatasource="lbu-meta"> <meta> <metaitem
    					name="browseprev" value="true"/> <metaitem name="browsenext" value="true"/> <metaitem
    					name="majorrevision" value="false"/> <metaitem name="excludefromalerts" value="true"/> </meta>
    					</doc:legacy-metadata> </doc:docinfo> </doc:metadata> 

    Source XML

     <docinfo partitionnum="1"> ................. ................. </docinfo> 

    Target XML

     <doc:metadata> <doc:docinfo doc-content-country="CA"> <dc:metadata> ...... ......
    					</dc:metadata> <doc:legacy-metadata metadatasource="lbu-meta"> <meta> <metaitem
    					name="partitionnum" value="1"/> </meta> </doc:legacy-metadata> </doc:docinfo>
    					</doc:metadata> 

    Example docinfo and docinfo:lbu-meta - Target

     <doc:legacy-metadata metadatasource="lbu-meta"> <meta> <metaitem name="browsenext"
    					value="false"/> <metaitem name="browseprev" value="false"/> <metaitem name="majorrevision"
    					value="false"/> <metaitem name="excludefromalerts" value="true"/> <metaitem name="partitionnum"
    					value="COMM1"/> <metaitem name="lbu-sourcename" value="Business Law Emerging Issues"/> <metaitem
    					name="document-type" value="Emerging Issue"/> <metaitem name="filename" value="BusLaw_EI_1850.xml"/>
    					</meta> </doc:legacy-metadata> 

    Create Required dc:metadata Element

    The element dc:metadata is the first required child element of doc:metadata/doc:docinfo. As such, dc:metadata should be created immediately after creating doc:metadata/doc:docinfo.

    Note:

    In addition, as part of workflow processing , ICCE will provide LNI values for each document. This PCDATA value will be mapped to the following:

    • dc:identifier[@lnmeta:identifier-scheme="LNI"]
    • dc:identifier[@lnmeta:identifier-scheme="PGUID"]

    The LNI value for dc:identifier[@lnmeta:identifier-scheme="PGUID"]will include the "urn:contentItem" namespace prefix.

    • Create dc:date[@lnmeta:datetype="conversion-date"]. This element will contain the date the output file was created during conversion.

      Note: The format of the content of all dc:date elements must be in 'YYYY-MM-DD'.

    LNI Values from ICCE

     <dc:identifier
    					lnmeta:identifier-scheme="LNI">5617-TBH1-67MJ-64K7-00000-00</dc:identifier> <dc:identifier
    					lnmeta:identifier-scheme="PGUID">urn:contentItem:5617-TBH1-67MJ-64K7-00000-00</dc:identifier>
    				

    dc:date[@lnmeta:datetype="conversion-date"]

     <dc:metadata> ... <dc:date lnmeta:datetype="conversion-date">2013-08-07</dc:date>
    					... </dc:metadata> 

    Description

     end topichead  CaseContent  
     start topichead  Metadata  
     rosetta element: docinfo 
     <topicref href="../../common_newest/Rosetta_docinfo-LxAdv-doc.metadata_doc.docinfo.dita"/> 
     *****************************************************************************
    	this template uses a global $dpsi parameter that should be placed in the 
    	stream driver file as:
    	
    		<xsl:param name="dpsi" as="xs:string" select=" 'From LBU Manifest File' "/>
    	
        this parameter can be used in any module in your stream.  Do not add 
        it as a variable or parameter in this file to avoid conflicts.
    	*******************************************************************************	
    	
    	
    <xsl:variable name="dpsi"/>
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo-LxAdv-doc.metadata_doc.docinfo.dita  
     CSN: Created docinfo and children from base.xsl 
     this template processes all the content that goes into doc:docinfo. 
    Namespace No namespace
    Match docinfo
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="docinfo">
      <doc:docinfo>
        <!--   add attribute doc-content-country   -->
        <!--Satbir: Added hardcore value inside attribute @doc-country-code only for HK-->
        <xsl:choose>
          <xsl:when test="starts-with($streamID, 'HK')">
            <xsl:attribute name="doc-content-country" select="'HK'"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="doc_content_country"/>
          </xsl:otherwise>
        </xsl:choose>
        <dc:metadata>
          <dc:identifier lnmeta:identifier-scheme="LNI">0000-0000-0000-0000-00000-00</dc:identifier>
          <dc:identifier lnmeta:identifier-scheme="PGUID">urn:contentItem:0000-0000-0000-0000-00000-00</dc:identifier>
          <xsl:apply-templates select="docinfo:load-date"/>
          <dc:date lnmeta:datetype="conversion-date">
            <xsl:value-of select="format-date(current-date(), '[Y0001]-[M01]-[D01]')"/>
          </dc:date>
          <xsl:apply-templates select="/COMMENTARYDOC/comm:info/pubdate" mode="dc.metadata"/>
          <!-- PLEASE DO NOT REMOVE UK-SPECIFIC CONDITIONS  -->
          <xsl:if test="starts-with($streamID, 'UK')">
            <xsl:apply-templates select="docinfo:custom-metafields/docinfo:custom-metafield[@name = ('editorialPublishedDate', 'createdDate', 'updatedDate')]"/>
          </xsl:if>
          <!-- 20170623:  MCJ:  Removed AU06 from this list in preference to using modules/docinfo/Rosetta_docinfo.doc-id-LxAdv-dcidentifier_lnmetaidentifier-scheme.xsl. -->
          <!--  WPK 2017-11-06.  Due to webstar, all of the following streams must now use modules\docinfo\Rosetta_docinfo.doc-id-LxAdv-dcidentifier_lnmetaidentifier-scheme.xsl
    				http://webstar.reedelsevier.com/WebStarWebApp/incident/viewIncident.do?incTktNum=7041473
    				Also, streams need to remove any stream empty template that would conflict, i.e. <xsl:template match=”docinfo:doc=id”/>.  
    				<xsl:if test="$streamID = ('AU10', 'AU13', 'AU16', 'AU17', 'AU19-CA', 'NZ14', 'NZ02', 'AU09', 'NZ10','HK09','AU19_CC')">
    					<xsl:if test="docinfo:doc-id">
    						<dc:identifier lnmeta:identifier-scheme="DOC-ID">
    							<xsl:value-of select="docinfo:doc-id"/>
    						</dc:identifier>
    					</xsl:if>
    				</xsl:if>
    				
    				<xsl:if test="$streamID=('NZ07-DN', 'NZ07DC','AU14','NZ08')">
    					<xsl:if test="docinfo:doc-id">
    						<dc:identifier lnmeta:identifier-scheme="DOC-ID">
    							<xsl:value-of select="docinfo:dpsi/@id-string"/>
    							<xsl:text>-</xsl:text>
    							<xsl:value-of select="docinfo:doc-id"/>
    						</dc:identifier>
    					</xsl:if>
    				</xsl:if>
    				-->
          <!-- Sudhanshu Srivastava: Added condition for CA03 to convert leg:officialname,leg:num to dc:title -->
          <xsl:if test="$streamID = 'CA03'">
            <xsl:choose>
              <xsl:when test="following-sibling::source_cttr:body/leg:info/leg:officialname">
                <xsl:apply-templates select="following-sibling::source_cttr:body/leg:info/leg:officialname"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:apply-templates select="following-sibling::source_cttr:body/case:headnote/case:info/case:casename" mode="dc.title"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
          <xsl:apply-templates select="docinfo:doc-heading | docinfo:doc-id"/>
          <!-- JD: 2017-10-10: VSTS Bug 352379: use docinfo:doc-heading for dc:title for UK01 -->
          <!-- CN: 2017-10-13: VSTS Bug 352379: use docinfo:doc-heading for dc:title added UK02 and UK04 -->
          <xsl:if test="$streamID = ('UK01','UK02','UK04')">
            <dc:title>
              <xsl:value-of select="/CASEDOC/docinfo/docinfo:doc-heading"/>
            </dc:title>
          </xsl:if>
          <!-- JD: UK01-UK04: case:casename to dc:title (id-CCCC-10531) -->
          <!--
    				<xsl:if test="$streamID = ('UK02','UK04')">
    				  <dc:title>
      				  <xsl:value-of select="concat(/CASEDOC/case:body/case:headnote/case:info/case:casename, ' ',/CASEDOC/case:body/case:headnote/case:info/case:reportercite/ci:cite[@type='cite4thisdoc']/ci:content)"/>
    				  </dc:title>
    				</xsl:if>
    				-->
          <!-- CN: 2017-10-13: VSTS Bug 352379: use docinfo:doc-heading for dc:title for UK03 -->
          <xsl:if test="$streamID='UK03'">
            <dc:title>
              <xsl:value-of select="/DIGESTDOC/docinfo/docinfo:doc-heading"/>
            </dc:title>
          </xsl:if>
          <!-- same as above, but different mode name -->
          <!--<xsl:if test="$streamID = ('UK04')">
    					<xsl:apply-templates select="/CASEDOC/case:body/case:headnote/case:info/case:casename[$streamID='UK04']" mode="title"/>
    				</xsl:if>-->
          <!-- JD: UK05: case:casename to dc:title (id-UK05-27824) -->
          <xsl:if test="$streamID = 'UK05'">
            <xsl:apply-templates select="/CITATORDOC/source_cttr:body/case:headnote/case:info/case:casename | /CITATORDOC/source_cttr:body/case2:headnote/case2:info/case2:casename" mode="dc.metadata"/>
          </xsl:if>
          <xsl:apply-templates select="docinfo:authorattribution"/>
          <!--  @@@ TODO:  update DITA to match this code!!!  -->
          <!-- Awantika: Removed /CASEDOC/case:body/case:headnote/case:info/case:courtinfo/case:juris from apply templates as this was creating unnecessary content(hkhk) mapping needs to be converted to <dc:coverage> in HK03 -->
          <xsl:choose>
            <xsl:when test="starts-with($streamID, 'CA08')">
              <xsl:apply-templates select="         /CASEDOC/case:body/case:headnote/case:info/case:courtinfo/case:juris |         /CITATORDOC/source_cttr:body/case:headnote/case:info/case:courtinfo/case:juris" mode="metadata"/>
            </xsl:when>
            <xsl:when test="$streamID = ('CA01', 'CA03', 'CA02CC','CA02DC', 'CA06', 'CA05', 'CA04', 'CA07','UK03','UK07','UK06', 'NZ07DN','NZ13')"/>
            <xsl:when test="$streamID='AU12'">
              <xsl:apply-templates select="/DIGESTDOC/dig:body/dig:info/leg:info/leg:juris" mode="metadata"/>
            </xsl:when>
            <xsl:when test="$streamID='NZ10'">
              <xsl:apply-templates select="/LEGDOC/leg:body/leg:info/leg:juris" mode="metadata"/>
            </xsl:when>
            <xsl:when test="$streamID='CA19'">
              <xsl:apply-templates select="/CASEDOC/case:body/case:headnote/case:info/case:courtinfo/case:juris" mode="metadata"/>
            </xsl:when>
            <xsl:otherwise>
              <!--*********************
    							Paul:  for AU08 this otherwise clause is applicable as is unedited.
    							It creates dc:coverage/location:state because I have a stream specific "metadata" mode template for leg:juris.
    							I've changed nothing here.  just noting that i'm leveraging this for AU08 court orders too.
    							***************************-->
              <!-- Awantika: added xpath /CITATORDOC/source_cttr:body/leg:info/leg:juris for AU20 -->
              <!--Satbir: Added Xpath "/DIGESTDOC/dig:body/dig:info/case:info/case:courtinfo/case:juris" for NZ07DC-->
              <!--Satbir: Mentioned first position for jursi handling "case:courtinfo[1]/case:juris" because juris comes twicely-->
              <!-- Awantika:2017-10-17- Added not(streamID='AU01') to /CASEDOC/case:body/case:headnote/case:info/case:courtinfo[1]/case:juris as this was creating data outside identifier. -->
              <!-- Awantika:2017-10-31- Removed not(streamID='AU01') to /CASEDOC/case:body/case:headnote/case:info/case:courtinfo[1]/case:juris data given was for NZ so changed back for AU01 -->
              <xsl:apply-templates select="         /CASEDOC/case:body/case:headnote/case:info/case:courtinfo[1]/case:juris |         /LEGDOC/leg:body/leg:info/leg:juris | /CITATORDOC/source_cttr:body/leg:info/leg:juris |         /CITATORDOC/source_cttr:body/case:headnote/case:info/case:courtinfo/case:juris |         /CITATORDOC/source_cttr:body/case2:headnote/case2:info/case2:courtinfo/case2:juris | /DIGESTDOC/dig:body/dig:info/case:info/case:courtinfo/case:juris" mode="metadata"/>
            </xsl:otherwise>
          </xsl:choose>
          <!-- Awantika: case:juris will also be converted to <dc:coverage> in HK03  -->
          <!--<xsl:if test="/CASEDOC/case:body/case:headnote/case:info/case:courtinfo/case:juris and $streamID = 'HK03'">
    					<dc:coverage>
    						<location:country>
    							<xsl:attribute name="codescheme">
    								<xsl:text>ISO-3166-1</xsl:text>
    							</xsl:attribute>
    							<xsl:attribute name="countrycode">
    								<xsl:text>HK</xsl:text>
    							</xsl:attribute>
    						</location:country>
    					</dc:coverage>
    				</xsl:if>-->
          <xsl:apply-templates select="/COMMENTARYDOC/comm:info [$streamID='USLPA']" mode="person_contributor"/>
          <xsl:if test="$streamID=('UK06','UK07')">
            <dc:coverage>
              <location:country>
                <xsl:attribute name="codescheme">
                  <xsl:text>ISO-3166-1</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="countrycode">
                  <xsl:text>GB</xsl:text>
                </xsl:attribute>
              </location:country>
            </dc:coverage>
          </xsl:if>
        </dc:metadata>
        <xsl:apply-templates select="docinfo:versioninfo[@hasotherversions='true'][$streamID='CA05']" mode="doc_version"/>
        <xsl:apply-templates select="/LEGDOC/docinfo/docinfo:custom-metafields/docinfo:custom-metafield[@name = 'actFirstDoc'][contains(upper-case(.), 'TRUE')][$streamID='CA05']" mode="firstActDoc"/>
        <xsl:apply-templates select="/COMMENTARYDOC/comm:info/classification [$streamID='USLPA']" mode="metadata_classification"/>
        <xsl:apply-templates select="docinfo:custom-metafields [$streamID='USLPA']" mode="metadata_custom"/>
        <!-- Sudhanshu Srivastava:
    			     Created on - 28-06-2017.
    			     Comments : The below condition will create classify:classification inside doc:docinfo based on if input source having (docinfo:custom-metafield name="is-first-document-in-enactment") or (docinfo:custom-metafield name="is-last-document-in-enactment").
    			-->
        <xsl:if test="($streamID=('UK06','UK07')) and (docinfo:custom-metafields/docinfo:custom-metafield[@name='is-first-document-in-enactment'] or docinfo:custom-metafields/docinfo:custom-metafield[@name='is-last-document-in-enactment'])">
          <classify:classification classscheme="actDocumentOrder">
            <xsl:apply-templates select="docinfo:custom-metafields/docinfo:custom-metafield[@name='is-first-document-in-enactment']" mode="isfirstdocumentinenactment"/>
            <xsl:apply-templates select="docinfo:custom-metafields/docinfo:custom-metafield[@name='is-last-document-in-enactment']" mode="islastdocumentinenactment"/>
          </classify:classification>
        </xsl:if>
        <!-- MDS - 2017-06-27 - For NZ07DN -->
        <xsl:if test="$streamID='NZ07-DN'">
          <xsl:apply-templates select="/DIGESTDOC/dig:body/dig:info/jrnl:articleinfo/pubnote[remotelink]"/>
        </xsl:if>
        <!-- process that belong in doc:docinfo -->
        <!--  @@@ TODO:  update DITA to match this code!!!  -->
        <!-- Sudhanshu Srivastava: in CA13 stream , i have no need to transform here 'docinfo:hier', so i am making changes for sequencing of 
    			docinfo:heir-->
        <xsl:if test="not($streamID = 'CA13')">
          <xsl:apply-templates select="docinfo:hier"/>
        </xsl:if>
        <!-- Priya Kaushal : Added below for the stream UK15 -->
        <xsl:apply-templates select="classification[$streamID='UK15']"/>
        <!--	<xsl:if test = "$streamID='UK15'">
    				<xsl:if test="./classification">
    					<classify:classification>
    						<xsl:attribute name="classscheme">
    							<xsl:value-of select="./classification/@classscheme"/>
    						</xsl:attribute>
    						<xsl:for-each select="./classification/classitem">
    							<classify:classitem>
    								<xsl:attribute name="classscheme">
    									<xsl:value-of select="./classification/classitem/@classscheme"/>
    								</xsl:attribute>
    								<meta>
    									<metaitem name="appliedby" value="human"/>
    								</meta>
    								<topic:topicReference xmlns:topic="urn:x-lexisnexis:content:topic:global:1"
    									xmlns:guid="urn:x-lexisnexis:content:guid:global:1">
    									<xsl:attribute name="guid:guid">
    									<xsl:value-of select="./classitem-identifier/classcode/@normval"/>
    								</xsl:attribute>
    								</topic:topicReference>
    							</classify:classitem>
    						</xsl:for-each>
    						
    						</classify:classification>	
    				</xsl:if>				
    			</xsl:if>
    			-->
        <xsl:apply-templates select="//case:reportercite[$streamID=('CA01','CA04')]" mode="docrelated-content"/>
        <!-- Vikas Rohilla : Added for the stream CA01 -->
        <xsl:apply-templates select="//refnum[@refnumtype = 'UCN'][$streamID = ('CA01', 'CA02CC', 'CA02DC', 'CA19', 'CA02DS','CA04')]" mode="docinfoMember"/>
        <xsl:apply-templates select="docinfo:doc-id[$streamID='CA03']" mode="membership"/>
        <xsl:apply-templates select="docinfo:bookseqnum"/>
        <xsl:apply-templates select="docinfo:alt-renditions"/>
        <!-- Awantika: Added for UK11 -->
        <xsl:choose>
          <xsl:when test="$streamID='UK11DA'">
            <xsl:apply-templates select="following-sibling::dig:body/dig:info/dig:subject[@display-name='Jurisdiction']"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="//dig:body/dig:info/dig:subject"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:call-template name="legacy-metadata"/>
        <!-- Sudhanshu Srivastava : transforming 'docinfo:hier' here for making sequence correct for CA13 stream. -->
        <xsl:if test="$streamID = 'CA13'">
          <xsl:apply-templates select="docinfo:hier"/>
        </xsl:if>
        <xsl:if test="$streamID = 'CA03' and following-sibling::source_cttr:body/leg:info/leg:relatedleg">
          <xsl:apply-templates select="following-sibling::source_cttr:body/leg:info/leg:relatedleg" mode="relatedcon"/>
        </xsl:if>
        <xsl:apply-templates select="docinfo:topiccodes"/>
        <xsl:apply-templates select="//case:headnote/case:length"/>
        <xsl:apply-templates select="docinfo:assoc-links"/>
        <!-- Sudhanshu added an applied template for  -->
        <xsl:apply-templates select="docinfo:changemanagementcode"/>
        <!-- process all docinfo:selector elements in the same wrapper -->
        <xsl:if test="docinfo:selector">
          <classify:classification classscheme="selector">
            <xsl:apply-templates select="docinfo:selector"/>
          </classify:classification>
        </xsl:if>
        <!-- CSN - 2017/09/26 - added parenthesis so this classification does not show up in every stream -->
        <xsl:if test="$streamID='AU18' and (parent::LEGDOC[@legtype='misc-inst'] or contains(child::docinfo:selector/text(), 'misc-inst'))">
          <classify:classification classscheme="au.admindoctype">
            <classify:classitem>
              <classify:classitem-identifier>
                <classify:classname>
                  <xsl:text>miscellaneous-instrument</xsl:text>
                </classify:classname>
              </classify:classitem-identifier>
            </classify:classitem>
          </classify:classification>
        </xsl:if>
        <!-- CSN 2017-11-15 Added UK18 to accomodate docinfo/classification needed for Quantum Stub documents. VSTS Bug 402801. -->
        <xsl:apply-templates select="classification[$streamID=('UK13','UK18')]"/>
        <xsl:apply-templates select="docinfo:topiccodes[$streamID='NZ10']"/>
        <xsl:apply-templates select="/LEGDOC/@legtype[$streamID='NZ12']" mode="NZClassify"/>
        <xsl:if test="/COMMENTARYDOC/docinfo/docinfo:lbu-meta/docinfo:metaitem[@name = 'PA-PGUID' or @name = 'TOPIC-PGUID' or @name = 'SUB-TOPIC-PGUID']">
          <classify:classification-grp classscheme="ln.indexing-terms">
            <classify:classification classscheme="ln.legal">
              <xsl:apply-templates select="/COMMENTARYDOC/docinfo/docinfo:lbu-meta/docinfo:metaitem[@name = 'PA-PGUID' or @name = 'TOPIC-PGUID' or @name = 'SUB-TOPIC-PGUID']" mode="classify"/>
            </classify:classification>
          </classify:classification-grp>
        </xsl:if>
        <!-- PLEASE DO NOT REMOVE UK-SPECIFIC CONDITIONS  -->
        <xsl:if test="starts-with($streamID, 'UK') and (@majorrevision or @excludefromalerts or docinfo:custom-metafields/docinfo:custom-metafield[@name = ('important', 'highlightFrequency', 'inEditorialReview', 'resultType', 'word-toc', 'isDocBuilderAvailable', 'isCorePrecedent')])">
          <xsl:apply-templates select="." mode="UKClassify"/>
        </xsl:if>
        <xsl:if test="//page">
          <xsl:variable name="pageList" select="//page"/>
          <doc:pagination>
            <xsl:for-each-group select="$pageList" group-by="@reporter">
              <doc:pagination-scheme>
                <xsl:if test="@reporter!=''">
                  <xsl:attribute name="page-scheme">
                    <xsl:value-of select="translate(@reporter,' ','_')"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:attribute name="page-scheme-type">reporter-abbreviation</xsl:attribute>
              </doc:pagination-scheme>
            </xsl:for-each-group>
          </doc:pagination>
        </xsl:if>
        <xsl:apply-templates select="/LEGDOC/@legtype[$streamID = ('AU19LA', 'AU15')]" mode="AUClassify"/>
        <xsl:apply-templates select="docinfo:currencystatement"/>
        <xsl:apply-templates select="docinfo:keywords[$streamID = 'UK15_DS']"/>
        <!--pawan: added to create  classify:classification[@classscheme="keywords"] from docinfo:keywords-->
        <xsl:apply-templates select="docinfo:lbu-indexing-terms"/>
        <xsl:apply-templates select="docinfo:lbu-subj"/>
        <xsl:apply-templates select="docinfo:lbu-juris"/>
        <xsl:apply-templates select="docinfo:overview"/>
        <xsl:apply-templates select="docinfo:versioninfo[$streamID != 'CA05']"/>
        <!-- Vikas Rohilla : Apply template for the streamID UK11DA					-->
        <!-- Awantika: Apply template for UK11DN -->
        <xsl:apply-templates select="classification[$streamID=('UK11DA','UK11DN','UK03')]"/>
        <!-- Vikas Rohilla : Updated the template for the highlight becomes doc:overview -->
        <xsl:apply-templates select="//dig:info/highlight[not(preceding-sibling::highlight)][$streamID = 'CA14']" mode="doc-overview"/>
        <xsl:apply-templates select="//row/entry[@colname = 'col1'][matches(., 'SUBJECTS/SUJETS:') or matches(., 'Subjects\\Sujets:')][$streamID = 'CA11']" mode="highlights"/>
        <xsl:apply-templates select="docinfo:custom-metafields/docinfo:custom-metafield[@name = 'actFirstDoc'][contains(., 'true')][($streamID = 'CA06') or ($streamID = 'CA07')or ($streamID = 'CA08')]" mode="classify"/>
        <xsl:apply-templates select="docinfo:custom-metafields/docinfo:custom-metafield[@name='act-id' or @searchtype='act-id'][($streamID = 'CA08') or ($streamID = 'CA07')]" mode="doc_membership"/>
        <xsl:apply-templates select="docinfo:versioninfo/docinfo:versionbranch[$streamID = ('CA05', 'CA06', 'CA08')]" mode="member"/>
        <xsl:apply-templates select="docinfo:custom-metafields/docinfo:custom-metafield[@name = 'act-id'][$streamID = ('CA06')]" mode="membership"/>
        <xsl:apply-templates select="following::ci:content[$streamID = ('CA06','CA05', 'CA08', 'CA07')]" mode="doc-related"/>
        <xsl:apply-templates select="following::leg:num[not(starts-with(.,'solsak'))][$streamID = ('CA08')]" mode="doc_related_content"/>
        <xsl:apply-templates select="following::leg:officialnum[1][not(child::ci:cite)][not(preceding-sibling::leg:num[child::ci:cite])][$streamID = ('CA05', 'CA07', 'CA08','CA06')]" mode="doc_related_content_officialnum"/>
        <xsl:apply-templates select="/LEGDOC/leg:body[child::leg:level][$streamID = ('CA06', 'CA07', 'CA08')]" mode="metadata"/>
        <xsl:apply-templates select="/LEGDOC/leg:body[$streamID = ('CA05')]" mode="doc_overview_bills"/>
        <xsl:apply-templates select="/COMMENTARYDOC/comm:body[$streamID = 'CA10']" mode="overviewmeta"/>
        <xsl:apply-templates select="/COMMENTARYDOC/comm:body[$streamID = 'CA09']" mode="doc_overview"/>
        <xsl:apply-templates select="/COMMENTARYDOC/docinfo/relationshipmetadata[$streamID='UK14']"/>
        <xsl:apply-templates select="//note[@notetype = 'other']/remotelink[contains(., '[version anglaise]') or contains(., '[French Version]')][$streamID = 'CA02DS']" mode="doc-related_content"/>
        <xsl:apply-templates select="//jrnl:body[$streamID = 'CA15']" mode="doc_overview"/>
        <!-- Awantika: Applied template for note scnario in AU20 -->
        <xsl:apply-templates select="//CITATORDOC/source_cttr:body/leg:info/note[@notetype = 'xref' and (@id = 'SCAP4' or 'SCAI4')]"/>
        <xsl:apply-templates select="docinfo:leginclude[$streamID = ('UK06','UK07')]"/>
      </doc:docinfo>
    </xsl:template>
    Template legacy-metadata
    Namespace No namespace
    Used by
    Template
    References
    Templates
    Variable
    Import precedence 0
    Source
    <xsl:template name="legacy-metadata">
      <!-- don't create doc:legacy-metadata unless at least one of the following is present -->
      <xsl:if test="docinfo:dpsi | /CITATORDOC/@citatordoctype | /CITATORDOC/@fullcourt | /CITATORDOC/@notannotated | /CITATORDOC/@shortannot | /CITATORDOC/@unreported | @browseprev | @browsenext | @partitionnum | @majorrevision | @excludefromalerts | @excludefromtoc | @id-string | docinfo:custom-metafields | //leg:info/leg:hier | docinfo:lbu-meta | docinfo:subtype | perjudge">
        <doc:legacy-metadata metadatasource="lbu-meta">
          <meta>
            <xsl:for-each select="/*[1]/docinfo[1]/@excludefromtoc">
              <metaitem>
                <xsl:attribute name="name">
                  <xsl:text>excludefromtoc</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="value">
                  <xsl:value-of select="."/>
                </xsl:attribute>
              </metaitem>
            </xsl:for-each>
            <xsl:choose>
              <!--			Vikas Rohilla : updated the and condition			-->
              <xsl:when test="docinfo:dpsi[@id-string] and not(./docinfo:lbu-meta/docinfo:metaitem[upper-case(@name) = 'DPSI'])">
                <xsl:apply-templates select="docinfo:dpsi"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="findDPSI"/>
              </xsl:otherwise>
            </xsl:choose>
            <!-- Awantika: metaitem mapping for case:courtcode in HK03. SP: also using this for CA19. Sudhanshu : Added  -->
            <xsl:if test="//case:courtcode[$streamID = ('HK03', 'CA19', 'CA02CC', 'CA01' ,'NZ03', 'AU13', 'UK01', 'UK03', 'NZ07-DN', 'NZ07DC' , 'AU07' , 'NZ17CC', 'AU09','HK09','MY01')]">
              <metaitem>
                <xsl:attribute name="name">
                  <xsl:text>case:courtcode</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="value">
                  <xsl:value-of select="//case:courtcode/text()"/>
                </xsl:attribute>
              </metaitem>
              <!-- Awantika: instruction ends -->
            </xsl:if>
            <!-- Awantika: Added metaitem for UK11DN for alert:alertReference and topic:topicReference-->
            <!-- BRT 10/3/17: commented this out in favor of the code on line 680 -->
            <!--xsl:if test="/DIGESTDOC/docinfo/classification[child::classitem[@classscheme='alert:alertReference']/classitem-identifier/classname['ModuleID']][$streamID = ('UK11DN','UK03','UK11DA')]">
    						<metaitem>
    							<xsl:attribute name="name">
    								<xsl:text>MODULE-CURRENTNESS-ALERT</xsl:text>
    							</xsl:attribute>
    							<xsl:attribute name="value">
    								<xsl:value-of select="/DIGESTDOC/docinfo/classification/classitem[@classscheme='alert:alertReference']/classitem-identifier[child::classname['ModuleID']]/classcode/@normval"/>
    							</xsl:attribute>
    						</metaitem>
    					</xsl:if-->
            <!-- BRT 10/3/17 commented out, use alert code as model for @classscheme='topic:topicReference' further down -->
            <!--xsl:if test="/DIGESTDOC/docinfo/classification[child::classitem[@classscheme='topic:topicReference']/classitem-identifier/classname['ModuleID']][$streamID = 'UK11DN']">
    						<metaitem>
    							<xsl:attribute name="name">
    								<xsl:text>MODULE-PGUID</xsl:text>
    							</xsl:attribute>
    							<xsl:attribute name="value">
    								<xsl:value-of select="/DIGESTDOC/docinfo/classification/classitem[@classscheme='topic:topicReference']/classitem-identifier[child::classname['ModuleID']]/classcode/@normval"/>
    							</xsl:attribute>
    						</metaitem>
    					</xsl:if-->
            <!-- JD: 20170526: added for UK05
    					"PLEASE NOTE that the element doc:legacy-metadata needs to be created only for case:courtcode occurring within
    					case:headnote/case:info/case:courtinfo. There is NO NEED to create doc:legacy-metadata for all other occurrences, eg.,
    					cttr:annot/case:info/case:courtinfo."
    					-->
            <xsl:if test="/CITATORDOC/source_cttr:body/case:headnote/case:info/case:courtinfo/case:courtcode[$streamID = 'UK05']">
              <metaitem>
                <xsl:attribute name="name">
                  <xsl:text>case:courtcode</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="value">
                  <xsl:value-of select="/CITATORDOC/source_cttr:body/case:headnote/case:info/case:courtinfo/case:courtcode/text()"/>
                </xsl:attribute>
              </metaitem>
            </xsl:if>
            <xsl:apply-templates select="//case:info/case:reportercite/@ln.user-displayed[$streamID='AU07']" mode="metadata"/>
            <!-- JD: end add for UK05 -->
            <xsl:apply-templates select="/CITATORDOC/@citatordoctype | /CITATORDOC/@fullcourt | /CITATORDOC/@notannotated | /CITATORDOC/@shortannot | /CITATORDOC/@unreported | @browseprev | @browsenext | @partitionnum | @majorrevision | @excludefromalerts | @id-string"/>
            <xsl:apply-templates select="docinfo:custom-metafields [not($streamID='USLPA')]"/>
            <xsl:if test="not($streamID = 'CA05')">
              <xsl:apply-templates select="//leg:info/leg:hier"/>
            </xsl:if>
            <xsl:apply-templates select="docinfo:lbu-meta"/>
            <xsl:apply-templates select="docinfo:subtype"/>
            <!-- Vikas Rohilla	: Apply templates added for the streamID CA02DC -->
            <xsl:apply-templates select="//case:courtcode[$streamID = ('CA02DC', 'CA02DS')]" mode="meta_item"/>
            <xsl:apply-templates select="//classification[@rendition and @classscheme][$streamID = 'CA02DC']" mode="meta-item"/>
            <xsl:call-template name="perjudge"/>
            <!--<xsl:apply-templates select="//case:courtinfo/case:courtcode" mode="metadata"/>-->
            <xsl:if test="$streamID = ('HK08', 'AU02')">
              <xsl:apply-templates select="//case:headnote/case:info/case:courtinfo/case:courtcode" mode="metadata"/>
            </xsl:if>
          </meta>
        </doc:legacy-metadata>
        <xsl:if test="$streamID='USLPA'">
          <xsl:apply-templates select="docinfo:custom-metafields"/>
        </xsl:if>
        <!-- Awantika: Need to create two legacy metadata one isdefault one is with @metadatasource="tracking-timestamp". 
    				1. For all documents, the conversion should add a date-timestamp in the format YYYYMMDDHHMMSS using doc:legacymetadata@
    metadatasource="tracking-timestamp"/meta containing meta/metaitem@name="conversiontimestamp"@
    value="YYYYMMDDHHMMSS"
    				2. If optional docinfo:custom-metafields/docinfo:custom-metafield[@name="lbu-publish-timestamp"] exists, create doc:legacymetadata[@
    metadatasource="tracking-timestamp"] and add child meta/metaitem[@name="lbu-publish-timestamp"]
    [@value="YYYYMMDDHHMMSS"] -->
        <xsl:if test="$streamID='AU20'">
          <doc:legacy-metadata metadatasource="tracking-timestamp">
            <meta>
              <metaitem>
                <xsl:attribute name="name">
                  <xsl:text>conversion-timestamp</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="value">
                  <xsl:choose>
                    <xsl:when test="docinfo:custom-metafields/docinfo:custom-metafield[@name='lbu-publish-timestamp']">
                      <xsl:value-of select="concat(docinfo:custom-metafields/docinfo:custom-metafield[@name='lbu-publish-timestamp'],format-dateTime(current-dateTime(),'[H01][m01][s]'))"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001][M01][D01][H01][m01][s]')"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:attribute>
              </metaitem>
              <xsl:if test="docinfo:custom-metafields/docinfo:custom-metafield[@name='lbu-publish-timestamp']">
                <metaitem>
                  <xsl:attribute name="name">
                    <xsl:text>lbu-publish-timestamp</xsl:text>
                  </xsl:attribute>
                  <xsl:attribute name="value">
                    <xsl:value-of select="docinfo:custom-metafields/docinfo:custom-metafield[@name='lbu-publish-timestamp']"/>
                  </xsl:attribute>
                </metaitem>
              </xsl:if>
            </meta>
          </doc:legacy-metadata>
        </xsl:if>
      </xsl:if>
      <!-- Brad Thacker: corrected metaitem for classitem[@classscheme='topic:topicReference'] UK15CS, UK15ds, UK12cs, UK11dn -->
      <xsl:for-each select="/*/docinfo/classification/classitem[@classscheme='topic:topicReference'][classitem-identifier/classname['ModuleID']]">
        <xsl:if test="$streamID=('UK11DN','UK12', 'UK15')">
          <doc:legacy-metadata metadatasource="lbu-meta">
            <meta>
              <metaitem>
                <xsl:attribute name="name">
                  <xsl:text>MODULE-PGUID</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="value">
                  <xsl:value-of select="./classitem-identifier[child::classname['ModuleID']]/classcode/@normval"/>
                </xsl:attribute>
              </metaitem>
              <!-- BRT: comment out for now - don't need topic pguids in shared services (yet) -->
              <!--xsl:for-each select="./classitem-identifier/classcode">
    							<xsl:if test="contains(./@normval, 'urn:topic:')">
    								<metaitem>
    									<xsl:attribute name="name">
    										<xsl:text>TOPIC-CURRENTNESS-ALERT</xsl:text>
    									</xsl:attribute>
    									<xsl:attribute name="value">
    										<xsl:value-of select="./@normval"/>
    									</xsl:attribute>
    								</metaitem>
    							</xsl:if>
    						</xsl:for-each-->
            </meta>
          </doc:legacy-metadata>
        </xsl:if>
      </xsl:for-each>
      <!-- Rohan Borkar: modifications end-->
      <!-- Rohan Borkar: corrected metaitem for UK11DA for alert:alertReference -->
      <xsl:for-each select="/DIGESTDOC/docinfo/classification/classitem[@classscheme='alert:alertReference']">
        <xsl:if test="$streamID=('UK11DN','UK03','UK11DA')">
          <doc:legacy-metadata metadatasource="lbu-meta">
            <meta>
              <metaitem>
                <xsl:attribute name="name">
                  <xsl:text>MODULE-CURRENTNESS-ALERT</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="value">
                  <xsl:value-of select="./classitem-identifier[child::classname['ModuleID']]/classcode/@normval"/>
                </xsl:attribute>
              </metaitem>
              <xsl:for-each select="./classitem-identifier/classcode">
                <xsl:if test="contains(./@normval, 'urn:topic:')">
                  <metaitem>
                    <xsl:attribute name="name">
                      <xsl:text>TOPIC-CURRENTNESS-ALERT</xsl:text>
                    </xsl:attribute>
                    <xsl:attribute name="value">
                      <xsl:value-of select="./@normval"/>
                    </xsl:attribute>
                  </metaitem>
                </xsl:if>
              </xsl:for-each>
            </meta>
          </doc:legacy-metadata>
        </xsl:if>
      </xsl:for-each>
      <!-- Rohan Borkar: modifications end-->
      <xsl:if test="$streamID=('AU13','HK09')">
        <doc:legacy-metadata metadatasource="rosetta">
          <meta>
            <xsl:for-each select="/CASEDOC/case:body/case:headnote/case:info/case:courtinfo/case:courtcode">
              <metaitem>
                <xsl:attribute name="name">case:courtcode</xsl:attribute>
                <xsl:attribute name="value" select="."/>
              </metaitem>
            </xsl:for-each>
          </meta>
        </doc:legacy-metadata>
      </xsl:if>
    </xsl:template>
    Template docinfo:dpsi
    Documentation

    Description

     JD: 20170524: adding this template (called above) 
    Namespace No namespace
    Match docinfo:dpsi
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:dpsi">
      <metaitem name="dpsi" value="{@id-string}"/>
    </xsl:template>
    Template perjudge
    Documentation

    Description

     person[@searchtype="JUDGES"] 
    Namespace No namespace
    Used by
    Template
    Import precedence 0
    Source
    <xsl:template name="perjudge">
      <!-- JD: 2017-07-14: added 'judge'; probably a data error from UK XSLT development -->
      <xsl:if test="//person[@searchtype = ('JUDGES','judge')]">
        <metaitem name="JUDGES" value="{//person[ @searchtype = ('JUDGES','judge') ]/name.text}"/>
      </xsl:if>
    </xsl:template>
    Template /CITATORDOC/@citatordoctype | /CITATORDOC/@fullcourt | /CITATORDOC/@notannotated | /CITATORDOC/@shortannot | /CITATORDOC/@unreported | @browseprev | @browsenext | @partitionnum | @majorrevision | @excludefromalerts | @id-string
    Namespace No namespace
    Match /CITATORDOC/@citatordoctype | /CITATORDOC/@fullcourt | /CITATORDOC/@notannotated | /CITATORDOC/@shortannot | /CITATORDOC/@unreported | @browseprev | @browsenext | @partitionnum | @majorrevision | @excludefromalerts | @id-string
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="/CITATORDOC/@citatordoctype | /CITATORDOC/@fullcourt | /CITATORDOC/@notannotated | /CITATORDOC/@shortannot | /CITATORDOC/@unreported | @browseprev | @browsenext | @partitionnum | @majorrevision | @excludefromalerts | @id-string">
      <metaitem name="{name()}" value="{.}"/>
    </xsl:template>
    Template findDPSI
    Namespace No namespace
    Used by
    Template
    Import precedence 0
    Source
    <xsl:template name="findDPSI">
      <xsl:choose>
        <!--	**************************************************************  
    		Vikas Rohilla : Commented this part because findDPSI templete called in the docinfo
    		template and after using the double dot (..) current element becomes
    		the CASEDOC and the docinfo:lbu-meta never find in the CASEDOC. 
    		and after match the conversion is skip becauese it is created by the 
    		docinfo:metaitem template.
    		**************************************************************-->
        <!--	<xsl:when test="../docinfo:lbu-meta/docinfo:metaitem[@name='DPSI']">
    				<metaitem xmlns="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
    					<xsl:attribute name="name">dpsi</xsl:attribute>
    					<xsl:attribute name="value" select="../docinfo:lbu-meta/docinfo:metaitem[@name='DPSI']/@value"/>
    				</metaitem>
    			</xsl:when>-->
        <!-- Vikas Rohilla : replaced double dot(..) with the single dot (.)  -->
        <xsl:when test="./docinfo:lbu-meta/docinfo:metaitem[upper-case(@name) = 'DPSI']"/>
        <xsl:otherwise>
          <metaitem>
            <xsl:attribute name="name">dpsi</xsl:attribute>
            <xsl:attribute name="value" select="$dpsi"/>
          </metaitem>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template comm:info/pubdatedc.metadata
    Namespace No namespace
    Match comm:info/pubdate
    Mode dc.metadata
    Import precedence 0
    Source
    <xsl:template match="comm:info/pubdate" mode="dc.metadata">
      <xsl:apply-templates mode="dc.metadata"/>
    </xsl:template>
    Template case:headnote/case:info/case:casename | case2:headnote/case2:info/case2:casenamedc.metadata
    Namespace No namespace
    Match case:headnote/case:info/case:casename | case2:headnote/case2:info/case2:casename
    Mode dc.metadata
    Import precedence 0
    Source
    <xsl:template match="case:headnote/case:info/case:casename | case2:headnote/case2:info/case2:casename" mode="dc.metadata">
      <!--  Original Target XPath:  dc:metadata/dc:title   -->
      <dc:title>
        <xsl:apply-templates select="@* | node()" mode="dc.metadata"/>
      </dc:title>
    </xsl:template>
    Template comm:info/pubdate/datedc.metadata
    Namespace No namespace
    Match comm:info/pubdate/date
    Mode dc.metadata
    Import precedence 0
    Source
    <xsl:template match="comm:info/pubdate/date" mode="dc.metadata">
      <dc:date lnmeta:datetype="pubdate">
        <xsl:value-of select="@year"/>
        <xsl:text>-</xsl:text>
        <xsl:value-of select="@month"/>
        <xsl:text>-</xsl:text>
        <xsl:value-of select="@day"/>
      </dc:date>
    </xsl:template>
    Template docinfo:lbu-meta/docinfo:metaitem[@name = 'PA-PGUID' or @name = 'TOPIC-PGUID' or @name = 'SUB-TOPIC-PGUID']classify
    Namespace No namespace
    Match docinfo:lbu-meta/docinfo:metaitem[@name = 'PA-PGUID' or @name = 'TOPIC-PGUID' or @name = 'SUB-TOPIC-PGUID']
    Mode classify
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="docinfo:lbu-meta/docinfo:metaitem[@name = 'PA-PGUID' or @name = 'TOPIC-PGUID' or @name = 'SUB-TOPIC-PGUID']" priority="2" mode="classify">
      <classify:classitem>
        <meta>
          <metaitem name="appliedby" value="human"/>
        </meta>
        <topic:topicReference guid:guid="{@value}"/>
      </classify:classitem>
    </xsl:template>
    Template docinfo:versionbranchmember
    Namespace No namespace
    Match docinfo:versionbranch
    Mode member
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="docinfo:versionbranch" priority="2" mode="member">
      <doc:membership>
        <ref:groupid group-type="variants-1">
          <ref:resourceid>
            <xsl:attribute name="ref:resourcekey">
              <xsl:text>urn:cldi-1:</xsl:text>
              <xsl:value-of select="translate(translate(translate(translate(@value,'          (	 ',''),'          	) ',''),'          ,	 ',''),'          ''	 ','')"/>
            </xsl:attribute>
          </ref:resourceid>
        </ref:groupid>
      </doc:membership>
    </xsl:template>
    Template docinfo:alt-renditions
    Documentation

    Description

     rosetta element: docinfo:alt-renditions 
     <topicref href="../../common_newest/Rosetta_docinfo.alt-renditions-LxAdv-doc.alt-renditions.dita"/> 
       docinfo:alt-renditions/docinfo:alt-rendition to
                doc:alt-renditions/doc:alt-rendition
            id-CCCC-10283
        
            
                Instructions [common element]
                This topic is used in numerous conversion instructions for several LBUs. It is a
                    shared topic rather than duplicated to ensure consistency and accuracy. The xml
                    snippets contained in this topic reflect markup needed for the Apollo image handling
                    application. The UK is the first LBU to move from Apollo to the Blobstore
                    application for image handling. Therefore, if this is a UK conversion instruction
                    document, please refer to the following topics for correct image handling markup.
                        lnlink[@service="ATTACHMENT"] to
                                ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE
                            images (id-CCCC-10542)
                        inlineobject to
                                ref:inlineobject for BLOBSTORE images
                            (id-CCCC-10540)
                        link[@filename] to
                                ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE
                            images (id-CCCC-10541)
                    
                docinfo:alt-renditions becomes
                        doc:alt-renditions with these children: 
                        docinfo:alt-renditions/docinfo:alt-rendition becomes
                                doc:alt-renditions/doc:alt-rendition with
                                @key and child as follows: 
                                docinfo:alt-renditions/docinfo:alt-rendition/link
                                    becomes
                                        doc:alt-renditions/doc:alt-rendition/ref:lnlink[@service="ATTACHMENT"].
                                        For conversion of link, please see
                                        the topic "link to
                                                ref.lnlink/@service="ATTACHMENT"".
                                
                                docinfo:alt-renditions/docinfo:alt-rendition/lnlink
                                    becomes
                                        doc:alt-renditions/doc:alt-rendition/ref:lnlink[@service="ATTACHMENT"].
                                        For conversion of lnlink, please
                                        see the topic .
                                
                            
                        
                    
                    For UK06 Laws/Acts/Bills/Measures and UK07 Regulation place the text of
                            leg:officialname in
                            doc:alt-renditions/doc:alt-rendition/ref:lnlink/ref:marker
                        instead of the source text as used within
                            docinfo:alt-renditions/docinfo:alt-rendition/link
                
            
            
                Source XML 1
                
                
    &lt;docinfo:alt-renditions&gt;
     &lt;docinfo:alt-rendition key="fulltext"&gt;
      &lt;link alttext="pdf version" filename="VIC_ACT_1998-25.pdf" type="pdf"&gt;PDF version of this Act&lt;/link&gt;
     &lt;/docinfo:alt-rendition&gt;
    &lt;/docinfo:alt-renditions&gt;
    
                
            
            
                Target XML 1
                
                
    &lt;doc:alt-renditions&gt;
     &lt;doc:alt-rendition key="fulltext"&gt;
      &lt;ref:lnlink service="ATTACHMENT"&gt;
       &lt;ref:marker role="label"&gt;PDF version of this Act&lt;/ref:marker&gt;
       &lt;ref:locator&gt;
        &lt;ref:locator-key&gt;
         &lt;ref:key-name name="attachment-key"/&gt;
         &lt;ref:key-value value="X-Y-VIC-ACT-1998-25"/&gt; 
         &lt;!-\- X and Y are LNI and SMI values obtained from CSSM -\-&gt;
        &lt;/ref:locator-key&gt;
        &lt;ref:locator-params&gt;
         &lt;proc:param name="componentseq" value="1"/&gt;
         &lt;proc:param name="attachment-type" value="PDF"/&gt;
         &lt;proc:param name="attachment-smi" value=""/&gt;
         &lt;!-\- @value populated with SMI obtained from CSSM -\-&gt;
         &lt;!-\- This @value assignment is done by conversion program -\-&gt;
        &lt;/ref:locator-params&gt;
       &lt;/ref:locator&gt;
      &lt;/ref:lnlink&gt;
     &lt;/doc:alt-rendition&gt;
    &lt;/doc:alt-renditions&gt;
    
                
            
            
                Source XML 2
                
                
    &lt;docinfo:alt-renditions&gt;
     &lt;docinfo:alt-rendition key="fulltext"&gt;
      &lt;link alttext="pdf version" filename="VIC_ACT_1998-25.pdf" type="pdf"&gt;PDF version of this Act&lt;/link&gt;
     &lt;/docinfo:alt-rendition&gt;
    &lt;/docinfo:alt-renditions&gt;
    &lt;!-\- ETC. -\-&gt;
    &lt;leg:officialname&gt;&lt;emph typestyle="bf"&gt;Commons Act 1236&lt;/emph&gt;&lt;/leg:officialname&gt;
                    
                
            
            
                Target XML 2
                
                
    &lt;legisinfo:officialtitle&gt;Commons Act 1236&lt;/legisinfo:officialtitle&gt;
    &lt;!-\- ETC. -\-&gt;
    &lt;doc:alt-renditions&gt;
     &lt;doc:alt-rendition key="fulltext"&gt;
      &lt;ref:lnlink service="ATTACHMENT"&gt;
       &lt;ref:marker role="label"&gt;Commons Act 1236&lt;/ref:marker&gt;
        &lt;ref:locator&gt;
         &lt;ref:locator-key&gt;
          &lt;ref:key-name name="attachment-key"/&gt;
          &lt;ref:key-value value="X-Y-VIC-ACT-1998-25"/&gt;
          &lt;!-\- X and Y are LNI and SMI values obtained from CSSM -\-&gt;
         &lt;/ref:locator-key&gt;
         &lt;ref:locator-params&gt;
          &lt;proc:param name="componentseq" value="1"/&gt;
          &lt;proc:param name="attachment-type" value="PDF"/&gt;
          &lt;proc:param name="attachment-smi" value=""/&gt;
          &lt;!-\- @value populated with SMI obtained from CSSM -\-&gt;
          &lt;!-\- This @value assignment is done by conversion program -\-&gt;
         &lt;/ref:locator-params&gt;
        &lt;/ref:locator&gt;
       &lt;/ref:lnlink&gt;
      &lt;/doc:alt-rendition&gt;
    &lt;/doc:alt-renditions&gt;
                    
                
            
            
                Source XML 3
                
                
    &lt;docinfo:alt-renditions&gt;
      &lt;docinfo:alt-rendition key="fulltext"&gt;
        &lt;lnlink service="ATTACHMENT" status="valid"&gt;
          &lt;marker role="content"&gt;PDF Format&lt;/marker&gt;
          &lt;api-params&gt;
            &lt;param name="attachment-key" value="application_for_apportionment-xxxx-xxxx-xxxxx-xx"/&gt;
            &lt;param name="attachment-type" value="pdf"/&gt;
            &lt;param name="attachment-smi" value="4364"/&gt;
            &lt;param name="componentseq" value="1"/&gt;
          &lt;/api-params&gt;
        &lt;/lnlink&gt;
      &lt;/docinfo:alt-rendition&gt;
    &lt;/docinfo:alt-renditions&gt;
                    
                
            
            
                Target XML 3
                
                
    &lt;doc:alt-renditions&gt;
     &lt;doc:alt-rendition key="fulltext"&gt;
      &lt;ref:lnlink service="ATTACHMENT"&gt;
       &lt;ref:marker role="content"&gt;PDF Format&lt;/ref:marker&gt;
        &lt;ref:locator&gt;
         &lt;ref:locator-key&gt;
          &lt;ref:key-name name="attachment-key"/&gt;
          &lt;ref:key-value value="application_for_apportionment-xxxx-xxxx-xxxxx-xx"/&gt;
         &lt;/ref:locator-key&gt;
         &lt;ref:locator-params&gt;
          &lt;proc:param name="componentseq" value="1"/&gt;
          &lt;proc:param name="attachment-type" value="PDF"/&gt;
          &lt;proc:param name="attachment-smi" value="4364"/&gt;
         &lt;/ref:locator-params&gt;
        &lt;/ref:locator&gt;
       &lt;/ref:lnlink&gt;
      &lt;/doc:alt-rendition&gt;
    &lt;/doc:alt-renditions&gt;
                    
                
            
            
            
                Changes
                2016-07-29: Added Note about xml snippets that illustrate
                        image handling. Note summarizes move from Apollo to Blobstore application. UK is
                        first LBU to move to Blobstore.
                2013-12-17: Added instruction and example for
                            docinfo:alt-rendition/lnlink. (Webteam
                    #247307)
                2013-05-01: Updated instructions and target example per
                        latest Apollo markup.
                2013-02-26: Updated target example per project
                        requirement.
                2012-10-29: Added instruction and example for UK06
                        Laws/Acts/Bills/Measures and UK07 Regulation place the text of
                            leg:officialname in
                            doc:alt-renditions/doc:alt-rendition/ref:lnlink/ref:marker
                        (Webteam #243521)
                2012-10-26: Changed to reflect recent requirements for attachment-type links.
                2012-09-06: Created.
    Vikas Rohilla : Template to match docinfo:alt-renditions and create doc:alt-renditions  
    Namespace No namespace
    Match docinfo:alt-renditions
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:alt-renditions">
      <xsl:element name="doc:alt-renditions">
        <xsl:apply-templates select="@* | node()"/>
      </xsl:element>
    </xsl:template>
    Template docinfo:alt-rendition
    Documentation

    Description

    Vikas Rohilla : Template to match docinfo:alt-rendition and create doc:alt-rendition  
    Namespace No namespace
    Match docinfo:alt-rendition
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:alt-rendition">
      <xsl:element name="doc:alt-rendition">
        <xsl:apply-templates select="@* | node()"/>
      </xsl:element>
    </xsl:template>
    Template docinfo:alt-rendition/@key
    Namespace No namespace
    Match docinfo:alt-rendition/@key
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:alt-rendition/@key">
      <xsl:attribute name="key" select="."/>
    </xsl:template>
    Template docinfo:assoc-links
    Documentation

    Description

    Instructions [common element]

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    docinfo:assoc-links becomes doc:related-content. Attribute @assoc-content is suppressed.

    docinfo:assoc-links-grp becomes doc:related-content-grp, and its descendents are processed as follows:

    • If present, docinfo:assoc-resource becomes ref:relatedresourceref/ref:relatedresourceid. Copy the value of @assoc-resourceid to @ref:resourcekey
    • The target value of doc:related-content-grp/@grptype depends on the existing attrribute in the source:
      • If docinfo:assoc-links-grp/@assoc-content exists, it becomes @grptype.
      • Otherwise, docinfo:assoc-links-grp/@display-name becomes @grptype.
    • heading/title becomes heading/title.

    The children below may occur within either level, docinfo:assoc-links or docinfo:assoc-links-grp, and convert as follows:

    • With one exception, text becomes doc:related-content-item/doc:related-content-desc/p/text. The exception to this rule is if and only if the only children of text are one or more link elements; in this case see the rule for link below and example #4.
    • link becomes doc:related-content-item/doc:related-content-link/ref:lnlink[@service="ATTACHMENT"].

      In addtion to this conversion being performed if the link element is a child of docinfo:assoc-links or docinfo:assoc-links-grp, it is also done when the only children of text are one or more linkelements. That is, if and only if all of a text/link element's other siblings are also link elements. In the text scenario, the start-tag and end-tag (but not the content) of text are dropped (see example #4). If there are multiple link elements, then multiple doc:related-content-item and children are created, one for each link element.

      For details about converting link to ref:lnlink[@service="ATTACHMENT"] see link rules in the General Markup section.

    • remotelink[@service="QUERY"] is suppressed. If nothing else is present then also suppress the parent.

      Note:

      This Note is applicable to CA03, and CA05-CA08 only If we have XPath docinfo:assoc-links-grp/remotelink[@service="QUERY"] or docinfo:assoc-links/remotelink[@service="QUERY"]then we don't need to suppress it from target but in certain condition for that stream-wise.

      • For CA06 and CA07 If document is having remotelink[@service="QUERY"] under the docinfo:assoc-links-grp[assoc-content="enabling"] and remotelink comes with attributes @remotekey1 with the start value "DOCINFO(XXXX)" and @remotekey2 comes with value All Canadian Statutes then it should be mapped with doc:related-content/doc:related-content-grp/doc:related-content-item[@content-type="enablingLeg"]/ref:relatedresourceref/ref:relatedresourceid/ref:resourcekey="urn:leg-id-1:XXXX" where XXXX will be taken from source attribute remotekey1 Refer Example 7.
      • For CA05 and CA08 If document is having remotelink[@service="QUERY"] under the docinfo:assoc-links or docinfo:assoc-links-grp and remotelink comes with attributes @remotekey2="All Canadian Regulations" then it should be mapped with doc:related-content/doc:related-content-grp[@grptype="subordinateLeg"]/doc:related-content-item[@content-type="subordinateLeg"]/ref:relatedresourceref/ref:relatedresourceid/ref:resourcekey="urn:leg-id-1:XXXX" where XXXX will be taken from source attribute remotekey1 Refer Example 8.
      • For CA05 - CA08 Conversion Needs to split multiple ORs into a separate doc:related-content-item. Refer Example 9 for CA06-CA07 streams.
      • For CA06 and CA07 docinfo:assoc-links-grp/@assoc-content="enabling" should map with doc:related-content-grp/@grptype="enablingLeg". Any heading found inside "docinfo:assoc-links-grp/remotelink" then it should be mapped with @doc:related-content-grp/heading/title. Refer Example 9.
      • For CA03 If document is having remotelink[@service="QUERY"] and remotelink comes with attributes @remotekey1 with the value "REFNUM(XXXX)" and @remotekey2 contains "All Canadian Summaries" then it should be mapped with doc:related-content/doc:related-content-grp/doc:related-content-item[@content-type="caseSummaries"]/ref:relatedresourceref/ref:relatedresourceid/ref:resourcekey="urn:ucn-1:XXXX" where XXXX will be taken from source attribute remotekey1. Any bilingual headings should be retained along with their associated @xml:lang. Refer Example 10.

    • remotelink[@service="DOC-ID"] becomes doc:related-content-item/doc:related-content-link/ref:lnlink[@service="DOCUMENT"]. If the parent docinfo:assoc-links contains @assoc-content="external-content-location", then add @content-type="external-content-location"] to doc:related-content-item. Create the following child elements:
      • Create ref:marker to capture the PCDATA of remotelink.
      • Create ref:locator and populate it as follows:
        • Create ref:locator-key and populate it as follows:
          • If @remotekey1="DOC-ID" then
            • ref:key-name/@name will have the value "DOC-ID".
            • key-value/@value will be the value of @dpsi followed by hyphen and concatenated with @refpt or @remotekey2, which ever is present (if both are present, use @remotekey2).
          • If @remotekey1="REFPTID" then
            • ref:key-name/@name will have the value "DOC-ID".
            • ref:key-value/@value will be the value of @dpsi followed by hyphen and concatenated with @docidref.
            • Create ref:locator/@anchoridref with value from @refpt or @remotekey2, which ever is present (if both are present, use @refpt).

        Note: If remotelink/@dpsi is not present, use value from docinfo:dpsi/@id-string or capture value from the LBU manifest file.

        Note: ref:locator/@anchoridref that begins with a number must have an underscore added at start. Also apply other identifier data type format as used for xml:id and ref:anchor/@id (e.g. change colon to underscore). Refer to the section titled "Identifiers to ID Data Type - Handling Pattern Restrictions", if that section exists in this CI.

    • remotelink[@href] becomes doc:related-content-item/doc:related-content-link/ref:lnlink[@service="URL"]. If the parent docinfo:assoc-links contains @assoc-content="external-content-location", then add @content-type="external-content-location"] to doc:related-content-item.

      For details on converting remotelink[@href] to ref:lnlink see remotelink rules in General Markup section.

    • lnlink[@service="QUERYLINK"] becomes doc:related-content-item/doc:related-content-link/ref:lnlink which is populated as follows:

      • lnlink[@service="QUERYLINK"] becomes ref:lnlink[@service="QUERYLINK"]
      • lnlink/marker becomes ref:lnlink/ref:marker
      • Create ref:locator and populate it as follows:
        • Create ref:locator-key and populate it as follows:
          • lnlink/key-name[@name="queryTemplatePGUID"] becomes ref:locator/ref:locator-key/ref:key-name[@name="queryTemplatePGUID"].
          • lnlink/key-value/@value becomes ref:locator/ref:locator-key/ref:key-value/@value
        • lnlink/api-params becomes ref:locator/ref:locator-params, and the children are mapped as follows:
          • For each api-params/param element, create a corresponding proc:param and populate the attributes:
            • param/@name becomes proc:param/@name
            • param/@value becomes proc:param/@value

    • lnlink[@service="ATTACHMENT"] becomes doc:related-content-item/doc:related-content-link/ref:lnlink which is populated as follows: See example 6 for more clarification.

      • lnlink[@service="ATTACHMENT"] becomes ref:lnlink[@service="ATTACHMENT"]
      • lnlink/marker becomes ref:lnlink/ref:marker
      • Create ref:locator and populate it as follows:
        • Create ref:locator-key and populate it as follows:
          • lnlink/api-params/param/@name="attachment-key" becomes ref:locator/ref:locator-key/ref:key-name/@name="attachment-key".
          • lnlink/api-params/param/@value becomes ref:locator/ref:locator-key/ref:key-value/@value

            Note: Conversion final output will be ref:key-value/@value="{LNI}-{SMI}-{X}" where as {X} is the lnlink/api-params/param/@value as described above and prepend {LNI} and {SMI} are not literal values, they show where the LNI and SMI values obtained from CSSM should be output. See the Example 6

        • lnlink/api-params becomes ref:locator/ref:locator-params, and the children are mapped as follows:
          • For each api-params/param element, create a corresponding proc:param and populate the attributes:
            • param/@name becomes proc:param/@name
            • param/@value becomes proc:param/@value

            Note: Also create the below markup in the target document while conversion

            • proc:param/@name="attachment-smi" and proc:param/@value="{SMI}"

              Note: @value populated with SMI obtained from CSSM. This @value assignment is done by conversion program

    • lnlink[@service="TRAVERSE"] becomes doc:related-content-item/doc:related-content-link/ref:lnlink[@service="TRAVERSE"]. If the parent docinfo:assoc-links contains @assoc-content="external-content-location", then add @content-type="external-content-location"] to doc:related-content-item.

      For details on converting lnlink[@service="TRAVERSE"] to ref:lnlink[@service="TRAVERSE"] see lnlink[@service="TRAVERSE"] rules in General Markup section.

    • lnlink[@service="URL"] becomes doc:related-content-item/doc:related-content-link/ref:lnlink[@service="URL"]. If the parent docinfo:assoc-links contains @assoc-content="external-content-location", then add @content-type="external-content-location"] to doc:related-content-item.

      For details on converting lnlink[@service="URL"] to ref:lnlink[@service="URL"] see lnlink[@service="URL"] rules in General Markup section.

    • ci:cite becomes doc:related-content-item/doc:related-content-link/ref:lnlink[@service="TRAVERSE"]. If the parent docinfo:assoc-links contains @assoc-content="external-content-location", then add @content-type="external-content-location"] to doc:related-content-item. Create the following child elements:
      • Create ref:marker to capture the PCDATA of ci:cite/ci:content.
      • ref:locator/ref:locator-key/ref:key-name/@name will have the value "normcite".
      • ref:locator/ref:locator-key/key-value/@value will be the value of ci:cite/ci:content.
      • Create ref:locator/ref:locator-params/proc:param[@name="normprotocol"]. If ci:cite/@normprotocol is present, create the attribute proc:param/@value and copy the value of normprotocol; otherwise, add @value="lexsee". This line is hard coded.
      • If docinfo:doc-country/@iso-cc exists, create ref:locator/ref:locator-params/proc:param[@name="countrycode"] with the attribute @value. The @value value is from docinfo:doc-country/@iso-cc.

    Source XML 1

    
    <docinfo:assoc-links>
     <remotelink alttext="Find related journals" cmd="f:exp" remotekey1="LEG-REF(Flood and Water Management Act 2010 OR FWMA 2010 w/3 s 48 OR ss 48 OR section 48 OR sections 48) OR &quot;Flood and Water Management Act 2010&quot; OR FWMA 2010 w/3 LEG-REF(s 48 OR ss 48 OR section 48 OR sections 48)" remotekey2="All Subscribed Journals Sources" service="QUERY">Find related journals</remotelink>
     <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="786617_SL" dpsi="02o0" docidref="ABC123">Find related subordinate legislation</remotelink>
    </docinfo:assoc-links>
    
                

    Target XML 1

    
    <doc:related-content>
     <doc:related-content-item>
      <doc:related-content-link>
       <ref:lnlink service="DOCUMENT">
        <ref:marker> Find related subordinate legislation </ref:marker>
        <ref:locator anchoridref="_786617_SL ">
         <ref:locator-key>
          <ref:key-name name="DOC-ID"/>
          <ref:key-value value="02o0-ABC123"/>
         </ref:locator-key>
        </ref:locator>    
       </ref:lnlink>
      </doc:related-content-link>
     </doc:related-content-item>
    </doc:related-content>
    
                

    Source XML 2

    
    <docinfo:assoc-links assoc-content="related-content-pod">
     <docinfo:assoc-links-grp assoc-content="related-documents">
      <heading>
       <title>Related Documents</title>
      </heading>
      <remotelink service="DOC-ID" remotekey1="DOC-ID" remotekey2="0ONJ_151450"  dpsi="0ONJ">Transferring patent rights</remotelink>
     </docinfo:assoc-links-grp>
     <docinfo:assoc-links-grp assoc-content="related-legislation">
      <heading>
       <title>Related Legislation</title>
      </heading>
      <text>Primary statute: 
       <ci:cite searchtype="LEG-REF" status="valid">
        <ci:sesslaw>
         <ci:sesslawinfo>
          <ci:sesslawnum num="1977_37a_Title"/>
         </ci:sesslawinfo>
         <ci:sesslawref>
          <ci:standardname normpubcode="UK_ACTS"/>
         </ci:sesslawref>
        </ci:sesslaw>
        <ci:content>Patents Act 1977</ci:content>
       </ci:cite>
      </text>
     </docinfo:assoc-links-grp>
    </docinfo:assoc-links>
    
                

    Target XML 2

    
    <doc:related-content>
     <doc:related-content-grp grptype="related-documents">
      <heading>
       <title>Related Documents</title>
      </heading>
      <doc:related-content-item>
       <doc:related-content-link>
        <ref:lnlink service="DOCUMENT">
         <ref:marker>Transferring patent rights</ref:marker>
         <ref:locator>
          <ref:locator-key>
           <ref:key-name name="DOC-ID"/>
           <ref:key-value value="0ONJ-0ONJ_151450"/>
          </ref:locator-key>
         </ref:locator>
        </ref:lnlink>
       </doc:related-content-link>
      </doc:related-content-item>
     </doc:related-content-grp>
     <doc:related-content-grp grptype="related-legislation">
      <heading>
       <title>Related Legislation</title>
      </heading>
      <doc:related-content-item>
       <doc:related-content-desc>
        <p>
         <text>Primary statute: 
          <lnci:cite status="valid">
           <lnci:sesslaw>
            <lnci:sesslawinfo>
             <lnci:sesslawnum num="1977_37a_Title"/>
            </lnci:sesslawinfo>
            <lnci:sesslawref>
             <lnci:standardname normpubcode="UK_ACTS"/>
            </lnci:sesslawref>
           </lnci:sesslaw>
           <lnci:content>Patents Act 1977</lnci:content>
          </lnci:cite>
         </text>
        </p>
       </doc:related-content-desc>
      </doc:related-content-item>
     </doc:related-content-grp>
    </doc:related-content>
    
                

    Source XML 3

    
    <docinfo:assoc-links>
     <remotelink alttext="Latest Times Law Reports" href="www.timesonline.co.uk/TGD/lexisDisplay/0,,,00.html" hrefclass="http">Latest Times Law Reports</remotelink>
      <ci:cite searchtype="BOOK-REF">
       <ci:content>Data technologies and patents (2012) 18 MCN 5</ci:content>
      </ci:cite>
    </docinfo:assoc-links>
    
                

    Target XML 3

    
    <doc:related-content>
     <doc:related-content-item>
      <doc:related-content-link>
       <ref:lnlink service="URL">
        <ref:marker>Latest Times Law Reports</ref:marker>
        <ref:locator>
         <ref:locator-key>
          <ref:key-name name="URL"/>
          <ref:key-value value="http://www.timesonline.co.uk/TGD/lexisDisplay/0,,,00.html"/>
         </ref:locator-key>
        </ref:locator>
       </ref:lnlink>
      </doc:related-content-link>
     </doc:related-content-item>
     <doc:related-content-item>
      <doc:related-content-link>
       <ref:lnlink service="TRAVERSE">
        <ref:marker role="label">Data technologies and patents (2012) 18 MCN 5</ref:marker>
        <ref:locator>
         <ref:locator-key>
          <ref:key-name name="normcite"/>
          <ref:key-value value="Data technologies and patents (2012) 18 MCN 5"/>
         </ref:locator-key>
         <ref:locator-params>
          <proc:param name="normprotocol" value="lexsee"/>
          <proc:param name="countrycode" value="GB"/>
         </ref:locator-params>
        </ref:locator>
       </ref:lnlink>
      </doc:related-content-link>
     </doc:related-content-item>
    </doc:related-content>
    
                

    Source XML 4, showing a text element containing only a link child element

    
    <docinfo:assoc-links-grp assoc-content="related-documents">
      <heading>
        <title>Related documents</title>
      </heading>
      <remotelink service="DOC-ID" remotekey1="REFPTID" newwindow="YES" refpt="0OLB_258264"
        dpsi="0OLB" status="invalid" docidref="e60348a7-cc9b-4d43-468b-55a207cd7f00">Serving the claim form—method, address, deemed service and dispensing with service</remotelink>
      <text searchtype="figure">
        <link filename="EXT_DR_List of authorised government departments for service.pdf"
          alttext="EXT_DR_List of authorised government departments for service.pdf" type="pdf"
          >List of authorised government departments for service</link>
      </text>
    </docinfo:assoc-links-grp>
    </docinfo:assoc-links>
    
         

    Target XML 4

    
    <doc:related-content>
      <doc:related-content-grp grptype="related-documents">
        <heading>
          <title>Related documents</title>
        </heading>
        <doc:related-content-item>
          <doc:related-content-link>
            <ref:lnlink service="DOCUMENT">
              <ref:marker>Serving the claim form—method, address, deemed service and
        dispensing with service</ref:marker>
              <ref:locator anchoridref="0OLB_258264">
                <ref:locator-key>
                  <ref:key-name name="DOC-ID"/>
                  <ref:key-value value="0OLB-e60348a7-cc9b-4d43-468b-55a207cd7f00"/>
                </ref:locator-key>
              </ref:locator>
            </ref:lnlink>
          </doc:related-content-link>
        </doc:related-content-item>
        <doc:related-content-item>
          <doc:related-content-link>
            <ref:lnlink service="ATTACHMENT">
              <ref:marker role="label">List of authorised government departments for service</ref:marker>
              <ref:locator>
                <ref:locator-key>
                  <ref:key-name name="attachment-key"/>
                  <ref:key-value value="{LNI}-{SMI}-EXT_DR_List of authorised government departments for service"/>
                  <!-- 
                      The {LNI} and {SMI} are not literal values, 
                      they show where the LNI and SMI values 
                      obtained from CSSM should be output. 
                  -->
                </ref:locator-key>
                <ref:locator-params>
                  <proc:param name="componentseq" value="1"/>
                  <proc:param name="attachment-type" value="PDF"/>
                  <proc:param name="attachment-smi" value=""/>
                  <!-- proc:param/@value is set to the SMI value obtained from CSSM. -->
                  <!-- This @value assignment is done by the conversion program. -->
                </ref:locator-params>
              </ref:locator>
            </ref:lnlink>
          </doc:related-content-link>
        </doc:related-content-item>
      </doc:related-content-grp>
    </doc:related-content>
    
         

    Source XML 5 - lnlink[@service="QUERYLINK"]

    
    <docinfo:assoc-links>
    <docinfo:assoc-links-grp display-name="VALUE_PROVIDED_BY_CONTENTEDITOR">
      <heading>
        <title>Query Links</title>
      </heading>
     <lnlink service="QUERYLINK">
        <key-name name="queryTemplatePGUID"/>
        <key-value value="urn:queryTemplate:1119"/>    
        <marker>Other Tax documents</marker>
        <api-params>
            <param name="queryParameter1" value="CA $#$ US"/> 
            <param name="queryParameter2" value="MA"/> 
            <param name="queryParameter3" value="-60"/> 
        </api-params>
    </lnlink>
    </docinfo:assoc-links-grp>
    </docinfo:assoc-links>
    
         

    Target XML 5

    
    <doc:related-content>
      <doc:related-content-grp grptype="VALUE_PROVIDED_BY_CONTENTEDITOR">
        <heading>
          <title>Query Links</title>
        </heading>
        <doc:related-content-item>
          <doc:related-content-link>
             <ref:lnlink service="QUERYLINK">
                    <ref:marker>Other Tax documents</ref:marker>
                    <ref:locator>
                      <ref:locator-key>
                        <ref:key-name name="queryTemplatePGUID"/>
                        <ref:key-value value="urn:queryTemplate:1119"/>
                      </ref:locator-key>
                      <ref:locator-params>
                        <proc:param name="queryParameter1" value="CA $#$ US"/>
                        <proc:param name="queryParameter2" value="MA"/>
                        <proc:param name="queryParameter3" value="-60"/>
                      </ref:locator-params>
                    </ref:locator>
                  </ref:lnlink>
          </doc:related-content-link>
        </doc:related-content-item>
      </doc:related-content-grp>
    </doc:related-content>
    
         

    Source XML 6 - lnlink[@service="ATTACHMENT"]

    <docinfo:assoc-links>
        <docinfo:assoc-links-grp assoc-content="related-documents">
            <heading>
                <title>Related Documents</title>
            </heading>
            <lnlink service="ATTACHMENT">
                <marker>See PDF rendition</marker>
                <api-params>
                    <param name="attachment-key" value="RSCS_14905_CURRENT-0001"/>
                    <param name="attachment-type" value="PDF"/>
                    <param name="componentseq" value="1"/>
                </api-params>
            </lnlink>
        </docinfo:assoc-links-grp>
    </docinfo:assoc-links>
         

    Target XML 6

    <doc:related-content-grp grptype="related-documents">
        <heading>
            <title>Related documents</title>
        </heading>
        <doc:related-content-item>
            <doc:related-content-link>
                <ref:lnlink service="ATTACHMENT">
                    <ref:marker role="label">See PDF rendition</ref:marker>
                    <ref:locator>
                        <ref:locator-key>
                            <ref:key-name name="attachment-key"/>
                            <ref:key-value value="{LNI}-{SMI}-RSCS_14905_CURRENT-0001"/>
                            <!-- 
                      The {LNI} and {SMI} are not literal values, 
                      they show where the LNI and SMI values 
                      obtained from CSSM should be output. 
                  -->
                        </ref:locator-key>
                        <ref:locator-params>
                            <proc:param name="componentseq" value="1"/>
                            <proc:param name="attachment-type" value="PDF"/>
                            <proc:param name="attachment-smi" value="{SMI}"/>
                            <!-- proc:param/@value is set to the SMI value obtained from CSSM. -->
                            <!-- This @value assignment is done by the conversion program. -->
                        </ref:locator-params>
                    </ref:locator>
                </ref:lnlink>
            </doc:related-content-link>
        </doc:related-content-item>
    </doc:related-content-grp>
         

    Source XML 7 - CA06-CA07 docinfo:assoc-links-grp/remotelink[@service="QUERY"]

            
    <docinfo:assoc-links>
      <docinfo:assoc-links-grp assoc-content="enabling">
          <heading>
            <title>Enabling Act</title>
          </heading>
          <remotelink remotekey1="DOCINFO(2cb2cdcca9bdd55a897d897ac67f7e39)" remotekey2="All Canadian Statutes" service="QUERY">Enabling Act</remotelink>
      </docinfo:assoc-links-grp>
    </docinfo:assoc-links>
    
            
          

    Target XML 7 - CA06-CA07docinfo:assoc-links-grp/remotelink[@service="QUERY"]

        
    <doc:related-content>
      <doc:related-content-grp grptype="enablingLeg">
         <heading>
           <title>Enabling Act</title>
         </heading>
         <doc:related-content-item content-type="enablingLeg">
            <ref:relatedresourceref>
                <ref:relatedresourceid ref:resourcekey="urn:leg-id-1:2cb2cdcca9bdd55a897d897ac67f7e39"/>
            </ref:relatedresourceref>
         </doc:related-content-item>
      </doc:related-content-grp>
    </doc:related-content>
        
     

    Source XML 8 - CA05 docinfo:assoc-links/remotelink[@service="QUERY"]

    <docinfo:assoc-links>
        <remotelink remotekey1="DOCINFO(5eff46c7fc603910e15eb944d97c13c0)"
            remotekey2="All Canadian Regulations" service="QUERY">Link to regulations enabled by this
            act</remotelink>
    </docinfo:assoc-links>
          

    Target XML 8 - CA05 docinfo:assoc-links/remotelink[@service="QUERY"]

    <doc:related-content>
        <doc:related-content-grp grptype="subordinateLeg">
          <doc:related-content-item content-type="subordinateLeg">
            <ref:relatedresourceref>
                <ref:relatedresourceid ref:resourcekey="urn:leg-id-1:5eff46c7fc603910e15eb944d97c13c0"/>
            </ref:relatedresourceref>
        </doc:related-content-item>
      </doc:related-content-grp>
    </doc:related-content>
     

    Source XML 9 (CA06-CA07)

            
    <docinfo:assoc-links>
                <docinfo:assoc-links-grp assoc-content="enabling">
                    <heading/>
                    <remotelink
                        remotekey1="DOCINFO(2ccc2826b445aebac6f6b3f8013e7931) 
                        OR DOCINFO(2ccc2826b445aebac6f6b3f8013e7932) 
                        OR DOCINFO(2ccc2826b445aebac6f6b3f8013e7933) 
                        ....
                        OR DOCINFO(2ccc2826b445aebac6f6b3f8013e7939)"
                        remotekey2="All Canadian Statutes" service="QUERY">Enabling Act</remotelink>
              </docinfo:assoc-links-grp>
    </docinfo:assoc-links>
            
          

    Target XML 9 (CA06-CA07)

            
    <doc:related-content>
      <doc:related-content-grp grptype="enablingLeg">
             <heading>
    		  <title>Enabling Act</title>
    	  </heading>
         <doc:related-content-item content-type="enablingLeg">
            <ref:relatedresourceref>
                <ref:relatedresourceid ref:resourcekey="urn:leg-id-1:2ccc2826b445aebac6f6b3f8013e7931"/>
            </ref:relatedresourceref>
         </doc:related-content-item>
         <doc:related-content-item content-type="enablingLeg">
            <ref:relatedresourceref>
                <ref:relatedresourceid ref:resourcekey="urn:leg-id-1:2ccc2826b445aebac6f6b3f8013e7932"/>
            </ref:relatedresourceref>
         </doc:related-content-item>
              <doc:related-content-item content-type="enablingLeg">
            <ref:relatedresourceref>
                <ref:relatedresourceid ref:resourcekey="urn:leg-id-1:2ccc2826b445aebac6f6b3f8013e7933"/>
            </ref:relatedresourceref>
         </doc:related-content-item>
         ....
         <doc:related-content-item content-type="enablingLeg">
            <ref:relatedresourceref>
                <ref:relatedresourceid ref:resourcekey="urn:leg-id-1:2ccc2826b445aebac6f6b3f8013e7939"/>
            </ref:relatedresourceref>
         </doc:related-content-item>
      </doc:related-content-grp>
    </doc:related-content>
            
          

    Source XML 10 (CA03)

            
        <docinfo:assoc-links>
          <remotelink service="QUERY" remotekey1="REFNUM(01704997)" remotekey2="All Canadian Summaries (Netletters, Digests, Summaries)" xml:lang="en-CA">Find case digests</remotelink>
          <remotelink service="QUERY" remotekey1="REFNUM(01704997)" remotekey2="All Canadian Summaries (Netletters, Digests, Summaries)" xml:lang="fr-CA">Résumés jurisprudentiels</remotelink>
        </docinfo:assoc-links>
            
          

    Target XML 10 (CA03)

            
    <doc:related-content>
      <doc:related-content-grp grptype="caseSummaries">
    	  <heading>
    		  <title xml:lang="en-CA">Find case digests</title>
    		  <title xml:lang="fr-CA">Résumés jurisprudentiels</title>
    	  </heading>
         <doc:related-content-item content-type="caseSummaries">
            <ref:relatedresourceref>
                <ref:relatedresourceid ref:resourcekey="urn:ucn-1:01704997"/>
            </ref:relatedresourceref>
         </doc:related-content-item>
      </doc:related-content-grp>
    </doc:related-content>
            
          

    Source XML 11 (LPA)

            
    <docinfo:assoc-links>
    	<docinfo:assoc-links-grp assoc-content="related-documents" content-type="form">
    		<docinfo:assoc-resource assoc-resourcename="BusLaw" assoc-resourceid="urn:krm:ABCDEABCDEABCDEABCDEABCDE3ABCDE1"/>
    		<lnlink service="TRAVERSE">
    			<key-name name="normcite"/>
    			<key-value value="LexisNexis Forms Form 219-8.22-7"/>
    			<marker role="label">Notice of Commencement Of Case Under Chapter 11 of the Bankruptcy Code, Meeting of Creditors, and Deadlines--Chapter 11 Corporation/Partnership Case; Official Form 9F </marker>
    		</lnlink>
    		<remotelink dpsi="0N5M" remotekey1="DOC-ID" remotekey2="0N5M_157408" service="DOC-ID">Exhibit A to Official Form 1</remotelink>
    		<remotelink href="http://www.justice.gov/ust/index.htm" newwindow="YES" service="SEARCH" status="valid">Official Website of the U.S. Trustee Program</remotelink>
    	</docinfo:assoc-links-grp>
    	<docinfo:assoc-links-grp assoc-content="related-documents" content-type="case">
    		<docinfo:assoc-resource assoc-resourcename="IP" assoc-resourceid="urn:krm:ABCDEABCDEABCDEABCDEABCDE3ABCDE2"/>
    		<lnlink service="TRAVERSE">
    			<key-name name="normcite"/>
    			<key-value value="2012 U.S. Bankr. Ct. Motions LEXIS 1246"/>
    			<marker role="label">2012 U.S. Bankr. Ct. Motions LEXIS 1246 (Bankr. N.D. Ill.)</marker>
    		</lnlink>
    		<remotelink dpsi="0N5N" remotekey1="DOC-ID" remotekey2="0N5N-0N5N_157355" service="DOC-ID">Emergency Motion for Joint Administration of Chapter 11 Cases</remotelink>
    		<remotelink href="http://www.uscourts.gov/RulesAndPolicies/FederalRulemaking/LocalCourtRules/USBankruptcyCourts.htm" newwindow="YES" service="SEARCH" status="valid">Official Website of the Federal Judiciary</remotelink>
    	</docinfo:assoc-links-grp>
    </docinfo:assoc-links>
            
          

    Target XML 11 (LPA)

            
    <doc:related-content>
    	<doc:related-content-grp grptype="related-documents">
    		<ref:relatedresourceref>
    			<ref:relatedresourceid ref:resourcekey="urn:krm:ABCDEABCDEABCDEABCDEABCDE3ABCDE1"/>
    		</ref:relatedresourceref>
    		<doc:related-content-item>
    			<doc:related-content-link>
    				<ref:lnlink service="TRAVERSE">
    					<ref:marker role="label">Notice of Commencement Of Case Under Chapter 11 of the Bankruptcy Code, Meeting of Creditors, and Deadlines--Chapter 11 Corporation/Partnership Case; Official Form 9F </ref:marker>
    					<ref:locator>
    						<ref:locator-key>
    							<ref:key-name name="normcite"/>
    							<ref:key-value value="LexisNexis Forms Form 219-8.22-7"/>
    						</ref:locator-key>
    						<ref:locator-params>
    							<proc:param name="normprotocol" value="lexsee"/>
    						</ref:locator-params>
    					</ref:locator>
    				</ref:lnlink>
    			</doc:related-content-link>
    		</doc:related-content-item>
    		<doc:related-content-item>
    			<doc:related-content-link>
    				<ref:lnlink service="DOCUMENT">
    					<ref:marker>Exhibit A to Official Form 1</ref:marker>
    					<ref:locator>
    						<ref:locator-key>
    							<ref:key-name name="DOC-ID"/>
    							<ref:key-value value="0N5M-0N5M_157408"/>
    						</ref:locator-key>
    					</ref:locator>
    				</ref:lnlink>
    			</doc:related-content-link>
    		</doc:related-content-item>
    		<doc:related-content-item>
    			<doc:related-content-link>
    				<ref:lnlink service="URL">
    					<ref:marker>Official Website of the U.S. Trustee Program</ref:marker>
    					<ref:locator>
    						<ref:locator-key>
    							<ref:key-name name="URL"/>
    							<ref:key-value value="http://www.justice.gov/ust/index.htm"/>
    						</ref:locator-key>
    					</ref:locator>
    				</ref:lnlink>
    			</doc:related-content-link>
    		</doc:related-content-item>
    	</doc:related-content-grp>
    	<doc:related-content-grp grptype="related-documents">
    		<ref:relatedresourceref>
    			<ref:relatedresourceid ref:resourcekey="urn:krm:ABCDEABCDEABCDEABCDEABCDE3ABCDE2"/>
    		</ref:relatedresourceref>
    		<doc:related-content-item>
    			<doc:related-content-link>
    				<ref:lnlink service="TRAVERSE">
    					<ref:marker role="label">2012 U.S. Bankr. Ct. Motions LEXIS 1246 (Bankr. N.D. Ill.)</ref:marker>
    					<ref:locator>
    						<ref:locator-key>
    							<ref:key-name name="normcite"/>
    							<ref:key-value value="2012 U.S. Bankr. Ct. Motions LEXIS 1246"/>
    						</ref:locator-key>
    						<ref:locator-params>
    							<proc:param name="normprotocol" value="lexsee"/>
    						</ref:locator-params>
    					</ref:locator>
    				</ref:lnlink>
    			</doc:related-content-link>
    		</doc:related-content-item>
    		<doc:related-content-item>
    			<doc:related-content-link>
    				<ref:lnlink service="DOCUMENT">
    					<ref:marker>Emergency Motion for Joint Administration of Chapter 11 Cases</ref:marker>
    					<ref:locator>
    						<ref:locator-key>
    							<ref:key-name name="DOC-ID"/>
    							<ref:key-value value="0N5N-0N5N_157355"/>
    						</ref:locator-key>
    					</ref:locator>
    				</ref:lnlink>
    			</doc:related-content-link>
    		</doc:related-content-item>
    		<doc:related-content-item>
    			<doc:related-content-link>
    				<ref:lnlink service="URL">
    					<ref:marker>Official Website of the Federal Judiciary</ref:marker>
    					<ref:locator>
    						<ref:locator-key>
    							<ref:key-name name="URL"/>
    							<ref:key-value value="http://www.uscourts.gov/RulesAndPolicies/FederalRulemaking/LocalCourtRules/USBankruptcyCourts.htm"/>
    						</ref:locator-key>
    					</ref:locator>
    				</ref:lnlink>
    			</doc:related-content-link>
    		</doc:related-content-item>
    	</doc:related-content-grp>
    </doc:related-content>
            
          

    Description

     rosetta element: docinfo:assoc-links related content
     <topicref href="../../common_newest/Rosetta_docinfo.assoc-links-LxAdv-doc.related-content.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.assoc-links-LxAdv-doc.related-content.dita  
     begin debug code 
    <xsl:param name="streamID" select="'CA07'"/>
      
      <xsl:include href="../../modules/nonamespace/Rosetta_identifier-LxAdv-ID_data_type-HandlingPatternRestrictions.xsl"/> 
      
      <xsl:template match="heading">
        <xsl:copy-of select="."/>
      </xsl:template>
     end debug code 
     Awantika:use of variable for AU20 
    Namespace No namespace
    Match docinfo:assoc-links
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:assoc-links">
      <xsl:if test="child::*[not(self::remotelink[@service='QUERY'])] or $streamID=('CA03', 'CA05', 'CA06', 'CA07', 'CA08')">
        <doc:related-content>
          <xsl:apply-templates select="@* | node()"/>
        </doc:related-content>
      </xsl:if>
    </xsl:template>
    Template docinfo:assoc-links/@assoc-content
    Namespace No namespace
    Match docinfo:assoc-links/@assoc-content
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:assoc-links/@assoc-content"/>
    Template docinfo:assoc-links/@display-name
    Documentation

    Description

     JL: to match DT, suppressing docinfo:assoc-links/@display-name 
    Namespace No namespace
    Match docinfo:assoc-links/@display-name
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:assoc-links/@display-name"/>
    Template docinfo:assoc-links-grp
    Namespace No namespace
    Match docinfo:assoc-links-grp
    Mode #default
    References
    Import precedence 0
    Source
    Template docinfo:assoc-links-grp/@assoc-content
    Namespace No namespace
    Match docinfo:assoc-links-grp/@assoc-content
    Mode #default
    References
    Import precedence 0
    Source
    Template docinfo:assoc-links-grp/@display-name
    Namespace No namespace
    Match docinfo:assoc-links-grp/@display-name
    Mode #default
    Import precedence 0
    Source
    Template docinfo:assoc-links-grp/@content-type
    Namespace No namespace
    Match docinfo:assoc-links-grp/@content-type
    Mode #default
    Import precedence 0
    Source
    Template docinfo:assoc-resource
    Namespace No namespace
    Match docinfo:assoc-resource
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:assoc-resource">
      <!--  Original Target XPath:  ref:relatedresourceref/ref:relatedresourceid   -->
      <ref:relatedresourceref>
        <ref:relatedresourceid>
          <xsl:apply-templates select="@* | node()"/>
        </ref:relatedresourceid>
      </ref:relatedresourceref>
    </xsl:template>
    Template docinfo:assoc-resource/@assoc-resourceid
    Namespace No namespace
    Match docinfo:assoc-resource/@assoc-resourceid
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:assoc-resource/@assoc-resourceid">
      <xsl:attribute name="ref:resourcekey">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template docinfo:assoc-resource/@assoc-resourcename
    Namespace No namespace
    Match docinfo:assoc-resource/@assoc-resourcename
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:assoc-resource/@assoc-resourcename"/>
    Template docinfo:assoc-links/text | docinfo:assoc-links-grp/text
    Documentation
    Namespace No namespace
    Match docinfo:assoc-links/text | docinfo:assoc-links-grp/text
    Mode #default
    References
    Import precedence 0
    Source
    Template link[parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp or parent::text[parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]]
    Namespace No namespace
    Match link[parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp or parent::text[parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]]
    Mode #default
    References
    Import precedence 0
    Source
    Template remotelink[@service='QUERY'][ancestor::docinfo:assoc-links][$streamID=('CA03', 'CA05', 'CA06', 'CA07', 'CA08')]
    Documentation

    Description

     MDS 2017-04-07 - Declared in Rosetta_link-LxAdv-ref.lnlink.xsl 
    <xsl:template match="link/@type">
        <xsl:choose>
          <xsl:when test=".=('para','page', 'ed-pnum','refpt','logo')">
            <xsl:message>attachment-type is invalid, cannot be determined.</xsl:message>
          </xsl:when>
          <xsl:when test=".=('pdf' , 'pdf-fillable')">PDF</xsl:when>
          <xsl:when test=".='hotdoc-nonfillable'">hotdoc</xsl:when>
          <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
        </xsl:choose>
      </xsl:template>
    Namespace No namespace
    Match remotelink[@service='QUERY'][ancestor::docinfo:assoc-links][$streamID=('CA03', 'CA05', 'CA06', 'CA07', 'CA08')]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Source
    <xsl:template match="remotelink[@service='QUERY'][ancestor::docinfo:assoc-links][$streamID=('CA03', 'CA05', 'CA06', 'CA07', 'CA08')]">
      <xsl:choose>
        <xsl:when test="(starts-with($streamID,'CA06') or starts-with($streamID ,'CA07')) and parent::docinfo:assoc-links-grp[@assoc-content='enabling']          and starts-with(@remotekey1 , 'DOCINFO(') and @remotekey2='All Canadian Statutes'">
          <xsl:call-template name="makeRelatedresourceref">
            <xsl:with-param name="contentType" select="'enablingLeg'"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:when test="(starts-with($streamID , 'CA05') or starts-with($streamID , 'CA08')) and starts-with(@remotekey1 , 'DOCINFO(') and @remotekey2='All Canadian Regulations'">
          <xsl:call-template name="makeRelatedresourceref">
            <xsl:with-param name="contentType" select="'subordinateLeg'"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:when test="starts-with(@remotekey1 , 'REFNUM(') and contains(@remotekey2,'All Canadian Summaries') and $streamID='CA03' and not(preceding-sibling::*[1][self::remotelink])">
          <doc:related-content-grp grptype="caseSummaries">
            <heading>
              <title xml:lang="en-CA">
                <xsl:value-of select="."/>
              </title>
              <title xml:lang="fr-CA">
                <xsl:value-of select="following-sibling::remotelink"/>
              </title>
            </heading>
            <doc:related-content-item content-type="caseSummaries">
              <ref:relatedresourceref>
                <ref:relatedresourceid>
                  <xsl:attribute name="ref:resourcekey">
                    <xsl:value-of select="concat('urn:ucn-1:' , substring-before(substring-after(@remotekey1 , 'REFNUM(') , ')'))"/>
                  </xsl:attribute>
                </ref:relatedresourceid>
              </ref:relatedresourceref>
            </doc:related-content-item>
          </doc:related-content-grp>
        </xsl:when>
        <!-- otherwise we do nothing for remotelink service QUERY -->
      </xsl:choose>
    </xsl:template>
    Template makeRelatedresourceref
    Namespace No namespace
    Used by
    Parameters
    QName Namespace
    contentType No namespace
    Import precedence 0
    Source
    <xsl:template name="makeRelatedresourceref">
      <xsl:param name="contentType"/>
      <xsl:for-each select="tokenize(@remotekey1 , '\s+OR\s+')">
        <doc:related-content-item>
          <xsl:attribute name="content-type" select="$contentType"/>
          <ref:relatedresourceref>
            <ref:relatedresourceid>
              <xsl:attribute name="ref:resourcekey">
                <xsl:value-of select="concat('urn:leg-id-1:', substring-before(substring-after(. , 'DOCINFO(') , ')'))"/>
              </xsl:attribute>
            </ref:relatedresourceid>
          </ref:relatedresourceref>
        </doc:related-content-item>
      </xsl:for-each>
    </xsl:template>
    Template remotelink[@service='DOC-ID'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Namespace No namespace
    Match remotelink[@service='DOC-ID'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Mode #default
    References
    Import precedence 0
    Source
    Template remotelink[@href][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Namespace No namespace
    Match remotelink[@href][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Mode #default
    References
    Import precedence 0
    Priority 25
    Source
    Template lnlink[@service='QUERYLINK'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Documentation
    Namespace No namespace
    Match lnlink[@service='QUERYLINK'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Mode #default
    Import precedence 0
    Source
    Template lnlink/marker
    Namespace No namespace
    Match lnlink/marker
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lnlink/marker">
      <ref:marker>
        <xsl:apply-templates select="@*|node()"/>
      </ref:marker>
    </xsl:template>
    Template lnlink/marker/@role
    Namespace No namespace
    Match lnlink/marker/@role
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lnlink/marker/@role">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template api-params
    Namespace No namespace
    Match api-params
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="api-params">
      <ref:locator-params>
        <xsl:apply-templates/>
        <xsl:if test="parent::lnlink[@service='ATTACHMENT']">
          <proc:param>
            <xsl:attribute name="name">attachment-smi</xsl:attribute>
            <xsl:attribute name="value"/>
            <xsl:message>need SMI from CSSM? Is this a parameter?</xsl:message>
          </proc:param>
        </xsl:if>
      </ref:locator-params>
    </xsl:template>
    Template param
    Namespace No namespace
    Match param
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="param">
      <xsl:if test="@name!='attachment-key'">
        <xsl:choose>
          <!-- Awantika: For AU20 one more param needs to be created with the name targetcontentType value practicalguidance -->
          <xsl:when test="$streamID='AU20'">
            <xsl:if test="not(following-sibling::param)">
              <proc:param>
                <xsl:attribute name="name">
                  <xsl:text>targetContentType</xsl:text>
                </xsl:attribute>
                <xsl:attribute name="value">
                  <xsl:text>practicalguidance</xsl:text>
                </xsl:attribute>
              </proc:param>
            </xsl:if>
            <xsl:variable name="docinfoidtext" select="/*/docinfo/docinfo:doc-id/text()"/>
            <!-- Awantika: Need to create only proc:param for topiccode in AU20 for the specific condition -->
            <xsl:if test="$streamID='AU20' and contains(lower-case($docinfoidtext),'analytics') and ancestor::source_cttr:annotations[@annotgroup='LPG']">
              <xsl:choose>
                <xsl:when test="@name[.='topiccode']">
                  <proc:param>
                    <xsl:attribute name="name">
                      <xsl:text>topiccode</xsl:text>
                    </xsl:attribute>
                    <xsl:attribute name="value">
                      <xsl:value-of select="@value"/>
                    </xsl:attribute>
                  </proc:param>
                </xsl:when>
                <xsl:otherwise/>
              </xsl:choose>
            </xsl:if>
          </xsl:when>
          <xsl:otherwise>
            <proc:param>
              <xsl:apply-templates select="@name | @value"/>
            </proc:param>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </xsl:template>
    Template param/@name | param/@value
    Namespace No namespace
    Match param/@name | param/@value
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="param/@name | param/@value">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template lnlink[@service='ATTACHMENT'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Mode #default
    Import precedence 0
    Source
    Template lnlink[@service='TRAVERSE'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Namespace No namespace
    Match lnlink[@service='TRAVERSE'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Mode #default
    Import precedence 0
    Source
    Template lnlink/@status
    Namespace No namespace
    Match lnlink/@status
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lnlink/@status"/>
    Template lnlink[@service='URL'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Namespace No namespace
    Match lnlink[@service='URL'][parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Mode #default
    Import precedence 0
    Source
    Template ci:cite[parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Namespace No namespace
    Match ci:cite[parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp]
    Mode #default
    Import precedence 0
    Source
    Template docinfo:bookseqnum[not( normalize-space( . ) = '' )]
    Documentation

    Description

    Instructions [common element]

    This is an LBU-supplied, unsigned numeric value that indicates the relative position of a document and must be unique within a source. docinfo:bookseqnum becomes doc:bookseqnum.

    Source XML

    		
    		<docinfo:bookseqnum>273181624</docinfo:bookseqnum>
    		
    			

    Target XML

    		
    		<doc:bookseqnum>273181624</doc:bookseqnum>
    		
    			

    Description

     <topicref href="../../common_newest/Rosetta_AU_NZ_docinfo.assoc-links-LxAdv-additional-rule.dita"/> 
    <xsl:include href="../../modules/docinfo/Rosetta_AU_NZ_docinfo.assoc-links-LxAdv-additional-rule.xsl"/>
     rosetta element: docinfo:bookseqnum 
     <topicref href="../../common_newest/Rosetta_docinfo.bookseqnum-LxAdv-doc.bookseqnum.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.bookseqnum-LxAdv-doc.bookseqnum.dita  
    Namespace No namespace
    Match docinfo:bookseqnum[not( normalize-space( . ) = '' )]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:bookseqnum[not( normalize-space( . ) = '' )]">
      <!--  Original Target XPath:  doc:bookseqnum   -->
      <doc:bookseqnum>
        <xsl:apply-templates select="@* | node()"/>
      </doc:bookseqnum>
    </xsl:template>
    Template docinfo:bookseqnum[ normalize-space( . ) = '' ]
    Documentation

    Description

        From Rosetta_Elements-LxAdv-Empty_Elements.dita / .xsl   
    Namespace No namespace
    Match docinfo:bookseqnum[ normalize-space( . ) = '' ]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:bookseqnum[ normalize-space( . ) = '' ]"/>
    Template docinfo:authorattribution
    Documentation

    Description

    Instructions [common element]

    docinfo:authorattribution/contrib becomes dc:metadata/dc:contributor

    If the attribute @ln.user-displayed exists on the element contrib, then supress the attribute in the target xml as shown below.

    Note: Conversion needs to suppress docinfo:authorattribution/contrib when it's the child of leg:levelinfo and levelinfo.This will be applicable to all pacific content streams.

    Source XML

           
            <docinfo>
                <docinfo:authorattribution>
                  <contrib ln.user-displayed="false">Ian Serisier</contrib>
                </docinfo:authorattribution>
             </docinfo>
                       
    			

    Target XML

          
          <doc:metadata>
            <doc:docinfo>
                <dc:metadata>
                    <dc:contributor>Ian Serisier</dc:contributor>
                </dc:metadata>       
            </doc:docinfo>
          </doc:metadata>
          
    			

    When person is an child of docinfo:authorattribution/contrib then docinfo:authorattribution/contrib/person becomes dc:metadata/dc:contributor/person:contributor@contributor-type="author"/person:person

    Source XML

           
    <docinfo>
        <docinfo:authorattribution>
            <contrib>
                <person>
                    <name.text>Assistant Professor Bernard McCabe</name.text>
                </person>
            </contrib>
        </docinfo:authorattribution>
    </docinfo>
              		

    Target XML

    <doc:docinfo>
        <dc:contributor>
            <person:contributor contributor-type="author">
                <person:person>
                    <person:name.text>Assistant Professor Bernard McCabe</person:name.text>
                </person:person>
            </person:contributor>
        </dc:contributor>
    </doc:docinfo>
    

    When docinfo:authorattribution element is having a running text then it becomes dc:metadata/dc:contributor.

    Source XML

           
            <docinfo>
                <docinfo:authorattribution>D C Pearce AO LLB (Adel) LLM (ANU) PhD (ANU)</docinfo:authorattribution>
             </docinfo>
                       
    			

    Target XML

          
          <doc:metadata>
            <doc:docinfo>
                <dc:metadata>
                    <dc:contributor>D C Pearce AO LLB (Adel) LLM (ANU) PhD (ANU)</dc:contributor>
                </dc:metadata>       
            </doc:docinfo>
          </doc:metadata>
          
    

    Exceptio scenario for AU14-Journals/Newsletters/Bulletins - When docinfo:authorattribution/contrib contains remotelink as a child element then conversion need to omit the remotelink element from conversion and retain the text in dc:contributor.

    Source XML

           
            <docinfo>
             <docinfo:authorattribution>
                <contrib>The following is an outline of the planned changes to the [#b#]<remotelink
                    dpsi="02IJ" remotekey1="REFPTID" service="DOC-ID" refpt="2000A24"
                    docidref="2000A24.BODY">Employment Relations Act 2000</remotelink>[#/b#] announced
                by Prime Minister John Key at the National Party conference on 18 July. It was added as
                a link from the press release of Minister of Labour Kate Wilkinson &#x201C;90-Day Trial
                Period extended to all employees&#x201D;, available at [#b#]<remotelink
                    href="www.beehive.govt.nz/release/90-day+trial+period+extended+all+employers"
                    hrefclass="http" newwindow="YES"
                    >www.beehive.govt.nz/release/90-day+trial+period+extended+all+employers</remotelink>[#/b#].
                The material is subject to Crown copyright protection.</contrib>
             </docinfo:authorattribution>
            </docinfo>
                       
    			

    Target XML

          
          <doc:metadata>
             <doc:docinfo>
                <dc:metadata>
                 <dc:contributor>The following is an outline of the planned changes to the
                     Employment Relations Act 2000 announced by Prime Minister John Key at the National
                    Party conference on 18 July. It was added as a link from the press release of
                    Minister of Labour Kate Wilkinson &#x201C;90-Day Trial Period extended to all
                    employees&#x201D;, available at www.beehive.govt.nz/release/90-day+trial+period+extended+all+employers.
                    The material is subject to Crown copyright protection.</dc:contributor>
                </dc:metadata>
            </doc:docinfo>
        </doc:metadata>
          
    

    Description

     rosetta element: docinfo:authorattribution 
     <topicref href="../../common_newest/Rosetta_docinfo.authorattribution-LxAdv-dc.contributor.dita"/> 
    Namespace No namespace
    Match docinfo:authorattribution
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:authorattribution">
      <dc:contributor>
        <xsl:apply-templates select="@* | node()"/>
      </dc:contributor>
    </xsl:template>
    Template docinfo:authorattribution[$streamID='AU08'][contrib/@ln.user-displayed='false']
    Namespace No namespace
    Match docinfo:authorattribution[$streamID='AU08'][contrib/@ln.user-displayed='false']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="docinfo:authorattribution[$streamID='AU08'][contrib/@ln.user-displayed='false']" priority="2"/>
    Template docinfo:authorattribution/contrib
    Namespace No namespace
    Match docinfo:authorattribution/contrib
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:authorattribution/contrib">
      <!--  Original Target XPath:  dc:metadata/dc:contributor   -->
      <xsl:apply-templates select="@* | node()"/>
    </xsl:template>
    Template docinfo:authorattribution/contrib/@ln.user-displayed
    Namespace No namespace
    Match docinfo:authorattribution/contrib/@ln.user-displayed
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:authorattribution/contrib/@ln.user-displayed"/>
    Template docinfo:authorattribution[parent::leg:levelinfo|parent::levelinfo]
    Namespace No namespace
    Match docinfo:authorattribution[parent::leg:levelinfo|parent::levelinfo]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:authorattribution[parent::leg:levelinfo|parent::levelinfo]"/>
    Template docinfo:authorattribution/contrib/person
    Namespace No namespace
    Match docinfo:authorattribution/contrib/person
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:authorattribution/contrib/person">
      <!--  Original Target XPath:  dc:metadata/dc:contributor/person:contributor@contributor-type="author"/person:person   -->
      <person:contributor contributor-type="author">
        <person:person>
          <xsl:apply-templates select="@* | node()"/>
        </person:person>
      </person:contributor>
    </xsl:template>
    Template docinfo:authorattribution/contrib/remotelink
    Namespace No namespace
    Match docinfo:authorattribution/contrib/remotelink
    Mode #default
    Import precedence 0
    Source
    Template docinfo:currencystatement[not(parent::leg:levelinfo | parent::levelinfo)]
    Documentation

    Description

    Instructions [common element]

    The source elementdocinfo:currencystatement becomes doc:docinfo/currencystatment.

    Note: Conversion needs to suppress docinfo:currencystatement when it's the child of leg:levelinfo and levelinfo. This will be applicable to all Pacific Content Streams.

    Source XML

                
                    <docinfo:currencystatement>Consolidated as in force on <date>10 September 2012</date></docinfo:currencystatement>
                
    	       

    Target XML

                
                    <doc:docinfo>
                        <currencystatement>Consolidated as in force on <date>10 September 2012</date></currencystatement>
                    </doc:docinfo>
                
    	      

    Description

    	<xsl:template match="leg:levelinfo">
    
    		<!-\-  Original Target XPath:  dc:metadata/dc:contributor/person:contributor@contributor-type="author"/person:person   -\->
    		<dc:metadata>
    			<dc:contributor>
    				<person:contributor>
    					<person:person>
    						<xsl:apply-templates select="@* | node()"/>
    					</person:person>
    				</person:contributor>
    			</dc:contributor>
    		</dc:metadata>
    
    	</xsl:template>
     rosetta element: docinfo:currencystatement 
     <topicref href="../../common_newest/Rosetta_docinfo.currencystatement-LxAdv-currencystatement.dita"/> 
    Namespace No namespace
    Match docinfo:currencystatement[not(parent::leg:levelinfo | parent::levelinfo)]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:currencystatement[not(parent::leg:levelinfo | parent::levelinfo)]">
      <!--  Original Target XPath:  doc:docinfo/currencystatement   -->
      <currencystatement>
        <xsl:apply-templates select="@* | node()"/>
      </currencystatement>
    </xsl:template>
    Template leg:levelinfo/docinfo:currencystatement | leg:levelinfo/docinfo:currencystatement/contrib | levelinfo/docinfo:currencystatement
    Namespace No namespace
    Match leg:levelinfo/docinfo:currencystatement | leg:levelinfo/docinfo:currencystatement/contrib | levelinfo/docinfo:currencystatement
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:levelinfo/docinfo:currencystatement | leg:levelinfo/docinfo:currencystatement/contrib | levelinfo/docinfo:currencystatement"/>
    Template docinfo:custom-metafields
    Documentation

    Description

    Instructions [common element]

    The only uses of docinfo:custom-metafield in Australian and New Zealand data all have @name="COURT-CLASSIFY". Since metafields with this name should be suppressed, all occurrances of docinfo:custom-metafield should be suppressed. Further, because docinfo:custom-metafield is the only child of docinfo:custom-metafields, the entire docinfo:custom-metafields can be suppressed.

    Source XML

    
    <docinfo:custom-metafields>
        <docinfo:custom-metafield name="date">20070919</docinfo:custom-metafield>
        <docinfo:custom-metafield name="country">1</docinfo:custom-metafield>
        <docinfo:custom-metafield name="juris">30</docinfo:custom-metafield>
        <docinfo:custom-metafield name="court">145</docinfo:custom-metafield>
        <docinfo:custom-metafield name="dpsi">03EX</docinfo:custom-metafield>
        <docinfo:custom-metafield searchtype="COURT-CLASSIFY">BCLabRelBd</docinfo:custom-metafield>
        <docinfo:custom-metafield searchtype="JURIS-CLASSIFY">BC</docinfo:custom-metafield>
        <docinfo:custom-metafield searchtype="CITED-COUNT">0</docinfo:custom-metafield>
    </docinfo:custom-metafields>
    
                

    The all above elements should be dropped except for docinfo:custom-metafield[@searchtype="CITED-COUNT"] and docinfo:custom-metafield[@name="dpsi"] .

    Source XML showing @name="COURT-CLASSIFY"

    
    <docinfo:custom-metafields>
        <docinfo:custom-metafield name="COURT-CLASSIFY">FCA</docinfo:custom-metafield>
    </docinfo:custom-metafields>
    
                

    The above elements should be dropped.

    Source XML showing @searchtype="CITED-COUNT"

    
    <docinfo:custom-metafields>
        <docinfo:custom-metafield searchtype="CITED-COUNT">0</docinfo:custom-metafield>
    </docinfo:custom-metafields>
    
                

    The above elements should be retained.

    Target XML

    
    <doc:legacy-metadata metadatasource="lbu-meta">
        <meta>
            <metaitem name="CITED-COUNT" value="0"/>
        </meta>
    </doc:legacy-metadata>
    
                

    Source XML showing @name="dpsi"

    
    <docinfo:custom-metafields>
        <docinfo:custom-metafield name="dpsi">03EX</docinfo:custom-metafield>
    </docinfo:custom-metafields>
    
                

    The above elements should be retained.

    Target XML

    
    <doc:legacy-metadata metadatasource="lbu-meta">
        <meta>
            <metaitem name="dpsi" value="03EX"/>
        </meta>
    </doc:legacy-metadata>
    
                

    For CA Dictionary only: docinfo:custom-metafield name="JURIS-SORT", docinfo:custom-metafield name="COURT-SORT, and docinfo:custom-metafield name="TERM-SORT, should be retained in the target.

    Source XML

    
    <docinfo:custom-metafields>
        <docinfo:custom-metafield name="JURIS-SORT">180</docinfo:custom-metafield>
        <docinfo:custom-metafield name="COURT-SORT">200</docinfo:custom-metafield>
        <docinfo:custom-metafield name="TERM-SORT">102840</docinfo:custom-metafield>
    </docinfo:custom-metafields>
    
                

    Target XML

    
    <doc:legacy-metadata metadatasource="lbu-meta">
        <meta>
            <metaitem name="JURIS-SORT" value="180"/>
            <metaitem name="COURT-SORT" value="200"/>
            <metaitem name="TERM-SORT" value="102840"/>
        </meta>
    </doc:legacy-metadata>
    
                

    Description

     rosetta element: docinfo:custom-metafields 
     <topicref href="../../common_newest/Rosetta_docinfo.custom-metafields-LxAdv-SUPPRESS.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.custom-metafields-LxAdv-SUPPRESS.dita  
    Namespace No namespace
    Match docinfo:custom-metafields
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:custom-metafields">
      <xsl:apply-templates select="docinfo:custom-metafield[@name='dpsi' or @searchtype='CITED-COUNT']"/>
      <xsl:if test="$streamID='CA12'">
        <xsl:apply-templates select="docinfo:custom-metafield[@name=('JURIS-SORT', 'COURT-SORT', 'TERM-SORT')]"/>
      </xsl:if>
    </xsl:template>
    Template docinfo:custom-metafield
    Namespace No namespace
    Match docinfo:custom-metafield
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:custom-metafield">
      <metaitem>
        <xsl:apply-templates select="@name"/>
        <xsl:apply-templates select="@searchtype"/>
        <xsl:attribute name="value">
          <xsl:apply-templates/>
        </xsl:attribute>
      </metaitem>
    </xsl:template>
    Template docinfo:custom-metafield/@name
    Namespace No namespace
    Match docinfo:custom-metafield/@name
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:custom-metafield/@name">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template docinfo:custom-metafield/@searchtype
    Namespace No namespace
    Match docinfo:custom-metafield/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:custom-metafield/@searchtype">
      <xsl:if test=".='CITED-COUNT'">
        <xsl:attribute name="name" select="."/>
      </xsl:if>
    </xsl:template>
    Template doc_content_country
    Documentation

    Description

    Instructions [common element]

    docinfo:doc-country[@iso-cc] becomes doc:docinfo[@doc-content-country].

    If docinfo:doc-country[@iso-cc="AU"], check the value of case:headnote/case:info/case:courtinfo//case:juris. If case:juris="NZ", set doc:docinfo[@doc-content-country="NZ"].

    Note: @doc-content-country is required.

    Note: docinfo:doc-country[@iso-cc] is used to specify the country in the source document and also becomes part of @xml:id as described in the instructions for Target @xml:lang.

    Source XML

    	<docinfo>
    			  ....
    		   <docinfo:doc-country iso-cc="AU"/>
    		   ....
    		   </docinfo>
    
    
    		

    Target XML

    <doc:docinfo doc-content-country="AU">
             ...
            </doc:docinfo>
    
    
    		

    Source XML - AU example with case:juris="NZ"

    
    
    <CITATORDOC>
     <docinfo>
       ....
       <docinfo:doc-country iso-cc="AU"/>
        ....
     </docinfo>
     <cttr:body>
        <case:headnote>
            <case:info>
            ...........
                <case:courtinfo>
                .........
                     <case:juris ln.user-displayed="false">NZ</case:juris>
                </case:courtinfo>
            </case:info>
        </case:headnote>
      </cttr:body>
    </CITATORDOC>
    
    		

    Target XML - AU example with case:juris="NZ"

    <doc:docinfo doc-content-country="NZ">
             ...
            </doc:docinfo>
    
    
    		

    Source XML

    <docinfo>
              ....
           <docinfo:doc-country iso-cc="CA"/>
           ....
           </docinfo>
    
    
    		

    Target XML

    <doc:docinfo doc-content-country="CA">
             ...
            </doc:docinfo>
    
    
    		

    Source XML - Example for UK Content

    <docinfo>
              ....
           <docinfo:doc-country iso-cc="GB"/>
           ....
           </docinfo>
    
    
    		

    Target XML - Example for UK Content

    <doc:docinfo doc-content-country="GB">
             ...
            </doc:docinfo>
    
    
    				

    Description

     rosetta element: docinfo:doc-country 
     <topicref href="../../common_newest/Rosetta_docinfo.doc-country_iso-cc-LxAdv-doc.docinfo_doc-content-country.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.doc-country_iso-cc-LxAdv-doc.docinfo_doc-content-country.dita  
    Namespace No namespace
    Used by
    Template
    Import precedence 0
    Source
    <xsl:template name="doc_content_country">
      <!-- This template creates @doc-content-country from doc-country 
                        however there is an NZ special case -->
      <!-- 2017-10-03 - MDS: Added handling for $streamID starts with 'HK' -->
      <!-- Awantika: 2017-10-11: added streamID HK in else to replace AU(which is given in input) -->
      <xsl:attribute name="doc-content-country" select=" if (//docinfo:doc-country/@iso-cc = 'AU' or ($streamID='AU08')) then                       if (//case:headnote/case:info/case:courtinfo//case:juris = 'NZ') then                        'NZ'                       else                                             if(starts-with($streamID, 'HK'))then 'HK' else 'AU'                        else                         if(starts-with($streamID, 'HK')) then                           if (//docinfo:doc-country/@iso-cc) then //docinfo:doc-country/@iso-cc                          else 'HK'                         else                         //docinfo:doc-country/@iso-cc "/>
    </xsl:template>
    Template docinfo:doc-heading
    Documentation

    Description

    Instructions [common element]

    docinfo:doc-heading becomes dc:metadata/dc:title.

    Exceptional scenario for CA Indices: When docinfo:doc-heading contains word TITLE: or NAME: or SITE: or SUBJECT: or RULE: or STATUTE: then conversion should drop the word TITLE: or NAME: or SITE: or SUBJECT: or RULE: or STATUTE: from conversion.

    Exceptional scenario for AU Legislative Citator: When docinfo:doc-heading contains text Overview Tab for then conversion should drop the this text Overview Tab for from conversion.

    Exceptional scenario for US Lexis Practice Advisor (LPA): In addition to the standard mapping above, perform the following mappings. An example has been added below. With this addition, the target output document will always contain three dc:title elements; the one created above without any attributes, as well as the two below with a @lnmeta:titlepurpose attribute:

    • docinfo:doc-heading also maps to become dc:metadata/dc:title[@lnmeta:titlepurpose='resultDisplayList'].
    • If docinfo:doc-heading ends with a string enclosed by parentheses (e.g. "Patent License Agreement (Pro-Licensee)"), remove the parentheses and the enclosed text, remove any trailing spaces in the remaining text, and the remaining text becomes the content of a new dc:metadata/dc:title[@lnmeta:titlepurpose='download'] element. If docinfo:doc-heading does not end with a string inside parentheses, map docinfo:doc-heading, with all of its text content, to a new dc:metadata/dc:title[@lnmeta:titlepurpose='download'] element.

    Source XML

    
    <docinfo:doc-heading>PART�1&#x2014;PRELIMINARY</docinfo:doc-heading>
    
    		

    Target XML

    
    <dc:title>PART�1&#x2014;PRELIMINARY</dc:title>
    
    		

    Source XML

    
    <docinfo:doc-heading>West Energy Ltd. (Re), [2007] A.E.U.B.D. No. 57</docinfo:doc-heading>
    
    		

    Target XML

    
    <dc:title>West Energy Ltd. (Re), [2007] A.E.U.B.D. No. 57</dc:title>
    
    		

    Source XML - Example for UK Content

    
    <docinfo:doc-heading>In re B (Children) (Care Proceedings: Standard of Proof) (CAFCASS intervening) - [2009] AC 11</docinfo:doc-heading>
    
    		

    Target XML - Example for UK Content

    
    <dc:title>In re B (Children) (Care Proceedings: Standard of Proof) (CAFCASS intervening) - [2009] AC 11</dc:title>
    
    		

    Note: If emph is child of docinfo:doc-heading then suppress emph element and retain its content in dc:title.

    Note: For Canada Contents: if nl is child of docinfo:doc-heading, then replace it with single space character. For furter details please see the following example.

    Source XML- From CAN

    
    <docinfo:doc-heading>90F32<nl/>Memorandum of Argument of the Applicant</docinfo:doc-heading>
                
    			

    Target XML

    
    <dc:title>90F32 Memorandum of Argument of the Applicant</dc:title>
                
    			

    Note: Exception Scenario for Canada CA14:

    Trademarks and related marks: When (TM) or (R) occur in docinfo:doc-heading, convert to unicode code point as follows:

    (TM) becomes &#8482; (R) becomes &#174;

    Source XML- From CA14

    <docinfo:doc-heading>Alan D. Gold's NetLetter(TM), Monday, November 24, 2008 - Issue 615</docinfo:doc-heading>            
    			

    Target XML for CA14

    
    <dc:title>Alan D. Gold's NetLetter&#8482;, Monday, November 24, 2008 - Issue 615</dc:title>
                
    			

    Source XML for US LPA Forms

    
    <docinfo:doc-heading>Patent License Agreement (Pro-Licensee)</docinfo:doc-heading>
              					
    					 

    Target XML for US LPA Forms

       
    <dc:metadata>
    	<dc:title>Patent License Agreement (Pro-Licensee)</dc:title>
    	<dc:title lnmeta:titlepurpose="resultDisplayList">Patent License Agreement (Pro-Licensee)</dc:title>
    	<dc:title lnmeta:titlepurpose="download">Patent License Agreement</dc:title>
    	...
    </dc:metadata>
     
                 

    Description

      un-comment out the following template rule to perform unit testing via XSpec file   
    xsl:template match="docinfo">
    		<test>
    			<xsl:call-template name="doc_content_country"/>
    		</test>
    	</xsl:template
     rosetta element: docinfo:doc-heading 
     <topicref href="../../common_newest/Rosetta_docinfo.doc-heading-LxAdv-dc.title.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.doc-heading-LxAdv-dc.title.dita  
    Namespace No namespace
    Match docinfo:doc-heading
    Mode #default
    References
    Parameters
    QName Namespace Select Type
    docHeadingStringsToRemove No namespace if ($streamID = 'CA11') then ( 'TITLE:' , 'NAME:' , 'SITE:' , 'SUBJECT:' , 'RULE:' , 'STATUTE:' ) else if ($streamID = 'CA15') then ('TITLE/TITRE:' , 'TITRE/TITLE:','CITED/CITÉ:','CITÉ/CITED:','CITE/CITED:','CITED:','TITLE:' , 'TITRE:') else 'Overview Tab for' xs:string*
    Import precedence 0
    Source
    <xsl:template match="docinfo:doc-heading">
      <!-- these are used as regexes  -->
      <xsl:param name="docHeadingStringsToRemove" as="xs:string*" select="if ($streamID = 'CA11') then ( 'TITLE:' , 'NAME:' , 'SITE:' , 'SUBJECT:' , 'RULE:' , 'STATUTE:' ) else if ($streamID = 'CA15') then ('TITLE/TITRE:' , 'TITRE/TITLE:','CITED/CITÉ:','CITÉ/CITED:','CITE/CITED:','CITED:','TITLE:' , 'TITRE:')  else  'Overview Tab for' "/>
      <xsl:variable name="outputText" as="xs:string*">
        <xsl:apply-templates/>
      </xsl:variable>
      <!--  Original Target XPath:  dc:title   -->
      <dc:title>
        <!--  remove any occurrence of $docHeadingStringsToRemove strings but assume case sensitive; also replace (TM) and (R) with the trademark and copyright characters, respectively, all depending on streamID   -->
        <xsl:choose>
          <xsl:when test=" $streamID = ( 'CA11' , 'AU20', 'CA15' ) ">
            <xsl:sequence select=" lnf:removeSequenceOfStrings( string-join( $outputText , '' ) , $docHeadingStringsToRemove , false() ) "/>
          </xsl:when>
          <xsl:when test=" $streamID = 'CA14' ">
            <xsl:sequence select="replace( replace( string-join( $outputText , '' ) , '\(TM\)' , '™' ) , '\(R\)' , '®' )"/>
          </xsl:when>
          <xsl:when test="$streamID = 'CA06' or $streamID = 'CA12' or $streamID = 'CA10'or $streamID = 'CA09'">
            <xsl:value-of select="."/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:otherwise>
        </xsl:choose>
      </dc:title>
      <xsl:if test="$streamID='USLPA'">
        <dc:title>
          <xsl:attribute name="lnmeta:titlepurpose">
            <xsl:text>resultDisplayList</xsl:text>
          </xsl:attribute>
          <xsl:apply-templates select="@* | node()"/>
        </dc:title>
        <dc:title>
          <xsl:attribute name="lnmeta:titlepurpose">
            <xsl:text>download</xsl:text>
          </xsl:attribute>
          <xsl:apply-templates select="@* | node()"/>
        </dc:title>
      </xsl:if>
    </xsl:template>
    Template docinfo:doc-heading/emph
    Namespace No namespace
    Match docinfo:doc-heading/emph
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:doc-heading/emph">
      <!--  Original Target XPath:  dc:title   -->
      <!--  emph is pass-through when under doc-heading   -->
      <xsl:apply-templates select="@* | node()"/>
    </xsl:template>
    Template docinfo:doc-heading/nl
    Namespace No namespace
    Match docinfo:doc-heading/nl
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:doc-heading/nl">
      <!--  Original Target XPath:  dc:title   -->
      <!--  @SBy:  nl becomes a space when under doc-heading; implemented for ***all*** streamIDs, not just Canada Contents...   -->
      <xsl:text> </xsl:text>
    </xsl:template>
    Template docinfo:doc-id
    Documentation

    Description

    Instructions [common element]

    Identifies the normalization scheme (e.g. URI, LNI, ISSN, et al.) used for the identifier. docinfo:doc-id becomes dc:metadata/dc:identifier[@lnmeta:identifier-scheme]. Also capture  docinfo:dpsi[@id-string]  and prepend the value, followed by hyphen, to create globally unique identifier.

    Note:

    If docinfo:dpsi[@id-string] is not present, the dpsi value must be captured from one of the following sources:

    • The value in docinfo/docinfo:lbu-meta/docinfo:metaitem[@name="DPSI"]/@value
    • The value in docinfo/docinfo:custom-metafields/docinfo:custom-metafield[@name="dpsi"]
    • The LBU manifest file

    Source XML

    
    <docinfo:dpsi id-string="008P"/>
    <docinfo:doc-id>VIC_ACT_1998-25_PT1</docinfo:doc-id>
    
    		

    Target XML

    
    <dc:identifier lnmeta:identifier-scheme="DOC-ID">008P-VIC_ACT_1998-25_PT1</dc:identifier>
    
    		

    Source XML

    
    <docinfo:dpsi id-string="0062"/>
    <docinfo:doc-id>CA00000005222733</docinfo:doc-id>
    
    		

    Target XML

    
    <dc:identifier lnmeta:identifier-scheme="DOC-ID">0062-CA00000005222733</dc:identifier>
    
    		

    Source XML - Example for UK content

    
    <docinfo:doc-id>5B323030395D2D312D41432E3131</docinfo:doc-id>
    
    		

    Target XML - Example for UK content

    
    <dc:identifier lnmeta:identifier-scheme="DOC-ID">0GNE-5B323030395D2D312D41432E3131</dc:identifier>
    
    		

    Note: In the above example 0GNE is the dpsi value, which will be captured from LBU manifest file.

    Source XML - Example for CA content with the dpsi value in docinfo/docinfo:lbu-meta/docinfo:metaitem[@name="DPSI"]/@value

    
    <docinfo>
        ...
        <docinfo:doc-id>CA00000000450962</docinfo:doc-id>
        ...
        <docinfo:lbu-meta>
            <docinfo:metaitem name="SRCNAME" value="ACFH"/>
            <docinfo:metaitem name="SRCDOCNO" value="00018000"/>
            <docinfo:metaitem name="DPSI" value="03MN"/>
        </docinfo:lbu-meta>
        ...
    </docinfo>
    
    		

    Target XML - Example for CA content

    
    <dc:identifier lnmeta:identifier-scheme="DOC-ID">03MN-CA00000000450962</dc:identifier>
    
    		

    Source XML - Example for CA content with the dpsi value in docinfo/docinfo:custom-metafields/docinfo:custom-metafield[@name="dpsi"]

    
    <docinfo>
        ...
        <docinfo:doc-id>474</docinfo:doc-id>
        ...
        <docinfo:custom-metafields>
             <docinfo:custom-metafield name="dpsi">03EX</docinfo:custom-metafield>
        </docinfo:custom-metafields>
        ...
    </docinfo>
    
    		

    Target XML - Example for CA content

    
    <dc:identifier lnmeta:identifier-scheme="DOC-ID">03EX-474</dc:identifier>
    
    		

    Description

     rosetta element: docinfo:doc-id 
     <topicref href="../../common_newest/Rosetta_PAC_docinfo.doc-id-LxAdv-dcidentifier_lnmetaidentifier-scheme.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.doc-id-LxAdv-dcidentifier_lnmetaidentifier-scheme.dita  
    Namespace No namespace
    Match docinfo:doc-id
    Mode #default
    References
    Parameter
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:doc-id">
      <!--  Original Target XPath:  dc:identifier[@lnmeta:identifier-scheme]   -->
      <dc:identifier lnmeta:identifier-scheme="DOC-ID">
        <xsl:choose>
          <xsl:when test="../docinfo:dpsi/@id-string">
            <xsl:value-of select="../docinfo:dpsi/@id-string"/>
          </xsl:when>
          <xsl:when test="../docinfo:dpsi">
            <xsl:value-of select="../docinfo:dpsi"/>
          </xsl:when>
          <xsl:when test="..//docinfo:custom-metafield[ lower-case(@name) = 'dpsi' ]">
            <xsl:value-of select="..//docinfo:custom-metafield[ lower-case(@name) = 'dpsi' ]"/>
          </xsl:when>
          <!-- Vikas Rohilla : updated for the docinfo:metaitem dpsi				-->
          <xsl:when test="..//docinfo:metaitem[ lower-case(@name) = 'dpsi' ]">
            <xsl:value-of select="..//docinfo:metaitem[ lower-case(@name) = 'dpsi' ]/@value"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$dpsi"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:text>-</xsl:text>
        <xsl:apply-templates/>
      </dc:identifier>
      <xsl:if test="$streamID=('AU16', 'AU17', 'AU19CA', 'NZ02', 'NZ07-DN', 'NZ14')">
        <xsl:choose>
          <xsl:when test="ends-with(., 'CTHLEG_') or ends-with(., '_CTH') or starts-with(., 'CTHLEG_')">
            <dc:coverage>
              <location:country codescheme="ISO-3166-1" countrycode="AU">AU</location:country>
            </dc:coverage>
          </xsl:when>
          <xsl:when test="ends-with(., 'NSWLEG_') or ends-with(., '_NSW') or starts-with(., 'NSWLEG_')">
            <dc:coverage>
              <location:state codescheme="ISO-3166-2" statecode="AU-NS">NSW</location:state>
            </dc:coverage>
          </xsl:when>
          <xsl:when test="ends-with(., 'QLDLEG_') or ends-with(., '_QLD') or starts-with(., 'QLDLEG_')">
            <dc:coverage>
              <location:state codescheme="ISO-3166-2" statecode="AU-QL">QLD</location:state>
            </dc:coverage>
          </xsl:when>
          <xsl:when test="ends-with(., 'SALEG_') or ends-with(., '_SA') or starts-with(., 'SALEG_')">
            <dc:coverage>
              <location:state codescheme="ISO-3166-2" statecode="AU-SA">SA</location:state>
            </dc:coverage>
          </xsl:when>
          <xsl:when test="ends-with(., 'TASLEG_') or ends-with(., '_TAS') or starts-with(., 'TASLEG_')">
            <dc:coverage>
              <location:state codescheme="ISO-3166-2" statecode="AU-TS">TAS</location:state>
            </dc:coverage>
          </xsl:when>
          <xsl:when test="ends-with(., 'VICLEG_') or ends-with(., '_VIC') or starts-with(., 'VICLEG_')">
            <dc:coverage>
              <location:state codescheme="ISO-3166-2" statecode="AU-VI">VIC</location:state>
            </dc:coverage>
          </xsl:when>
          <xsl:when test="ends-with(., 'WALEG_') or ends-with(., '_WA') or starts-with(., 'WALEG_')">
            <dc:coverage>
              <location:state codescheme="ISO-3166-2" statecode="AU-WA">WA</location:state>
            </dc:coverage>
          </xsl:when>
          <xsl:when test="ends-with(., 'NTLEG_') or ends-with(., '_NT') or starts-with(., 'NTLEG_')">
            <dc:coverage>
              <location:state codescheme="ISO-3166-2" statecode="AU-NT">NT</location:state>
            </dc:coverage>
          </xsl:when>
          <xsl:when test="ends-with(., 'ACTLEG_') or ends-with(., '_ACT') or starts-with(., 'ACTLEG_')">
            <dc:coverage>
              <location:state codescheme="ISO-3166-2" statecode="AU-CT">ACT</location:state>
            </dc:coverage>
          </xsl:when>
          <xsl:otherwise/>
        </xsl:choose>
      </xsl:if>
    </xsl:template>
    Template xml_lang
    Documentation

    Description

    Instructions [common element]

    Since dc:language is not used, docinfo:doc-lang[@lang] only becomes part of @xml:lang as described in Target @xml:lang and is otherwise suppressed.


    Description

     Awantika: Using common module 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    <xsl:include
    		href="../../modules/docinfo/Rosetta_PAC_docinfo.doc-id-LxAdv-dcidentifier_lnmetaidentifier-scheme.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     rosetta element: docinfo:doc-lang 
     <topicref href="../../common_newest/Rosetta_docinfo.doc-lang-LxAdv-ROOT_xmllang.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.doc-lang-LxAdv-ROOT_xmllang.dita  
    Namespace No namespace
    Used by
    Import precedence 0
    Source
    <xsl:template name="xml_lang">
      <!-- This template creates @xml:lang from doc-lang and doc-country 
                        however there is an NZ special case -->
      <!-- 2017-10-03 - MDS: Added handling for $streamID starts with 'HK' -->
      <xsl:attribute name="xml:lang" select=" concat(  //docinfo:doc-lang/@lang ,                     '-' ,                     if (//docinfo:doc-country/@iso-cc = 'AU' or ($streamID='AU08')) then                      if (//case:headnote/case:info/case:courtinfo//case:juris = 'NZ') then                       'NZ'                      else                       'AU'                     else                       if(starts-with($streamID, 'HK')) then                         if (//docinfo:doc-country/@iso-cc) then //docinfo:doc-country/@iso-cc                        else 'HK'                       else                      //docinfo:doc-country/@iso-cc                    ) "/>
    </xsl:template>
    Template docinfo:dpsi[@id-string]
    Documentation

    Description

    Instructions [common element]

    docinfo:dpsi[@id-string] becomes doc:metadata/doc:docinfo/doc:legacy-metadata[@metadatasource="lbu-meta"]/meta/metaitem with attributes @name="dpsi" and @value set to @id-string. Note that only one meta is created for the various metaitem child elements that are created while processing docinfo and docinfo:dpsi. For more information, see the instructions for docinfo.

    Note: @id-string value is also used in mapping for docinfo:doc-id

    Note: If docinfo:dpsi[@id-string] is not present, the dpsi value must be captured from one of the following sources:

    • The value in docinfo/docinfo:lbu-meta/docinfo:metaitem[@name="DPSI"]/@value
    • The LBU manifest file

    Source XML with no attributes on docinfo

    
    	<docinfo>
    		<docinfo:dpsi id-string="008P"/>
    		.................
    		.................
    	</docinfo>
    
    	

    Target XML

    
    <doc:docinfo doc-content-country="AU">
      <doc:legacy-metadata metadatasource="lbu-meta">
    	<meta>
    	  <metaitem name="dpsi" value="008P"/>
    	</meta>
      </doc:legacy-metadata>
    	.................
    	.................
    </docinfo>
    
    	

    Source XML with an attribute on docinfo

    
        <docinfo partitionnum="2">
    		<docinfo:dpsi id-string="006F">
    		.................
    		.................
    	</docinfo>
    
    	

    Target XML

    
    <doc:docinfo doc-content-country="AU">
      <doc:legacy-metadata metadatasource="lbu-meta">
    	<meta>
    		 <metaitem name="partitionnum" value="2"/> 
    		<metaitem name="dpsi" value="006F"/>
    	</meta>
      </doc:legacy-metadata>
    	.................
    	.................
    </docinfo>
    
    
    	

    Description

      un-comment out the following template rule to perform unit testing via XSpec file   
    xsl:template match="docinfo">
    		<test>
    			<xsl:call-template name="xml_lang"/>
    		</test>
    	</xsl:template
     rosetta element: docinfo:dpsi 
     <topicref href="../../common_newest/Rosetta_docinfo.dpsi-LxAdv-doc.legacy-metadata_metadatasource_lbu-meta.meta.metaitem.dita"/> 
    Namespace No namespace
    Match docinfo:dpsi[@id-string]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:dpsi[@id-string]">
      <metaitem>
        <xsl:attribute name="name">dpsi</xsl:attribute>
        <xsl:attribute name="value" select="@id-string"/>
      </metaitem>
    </xsl:template>
    Template docinfo:dpsi[not(@id-string) and ../docinfo:lbu-meta/docinfo:metaitem[@name='DPSI']]
    Documentation

    Description

     docinfo/docinfo:lbu-meta/docinfo:metaitem[@name="DPSI"]/@value 
    Namespace No namespace
    Match docinfo:dpsi[not(@id-string) and ../docinfo:lbu-meta/docinfo:metaitem[@name='DPSI']]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:dpsi[not(@id-string) and ../docinfo:lbu-meta/docinfo:metaitem[@name='DPSI']]">
      <metaitem>
        <xsl:attribute name="name">dpsi</xsl:attribute>
        <xsl:attribute name="value" select="../docinfo:lbu-meta/docinfo:metaitem[@name='DPSI']/@value"/>
      </metaitem>
    </xsl:template>
    Template docinfo:hier
    Namespace No namespace
    Match docinfo:hier
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:hier">
      <!--  Original Target XPath:  doc:hier   -->
      <doc:hier>
        <xsl:if test="$streamID = ('CA05', 'CA06', 'CA07', 'CA08')">
          <xsl:if test="child::docinfo:hierlev/@exclude-from-displayunits = 'true'">
            <xsl:attribute name="includeintoc">
              <xsl:text>false</xsl:text>
            </xsl:attribute>
          </xsl:if>
        </xsl:if>
        <!--  @SBy:  process the first descendant docinfo:hierlev/@exclude-from-displayunits where that attribute is true.  So if this attribute appears on any docinfo:hierlev and is true, then @includeintoc will be set to false  -->
        <!-- UK06 Requires indicators of first and last  -->
        <xsl:if test="$streamID = ('UK06','UK07')">
          <proc:processinginfo>
            <xsl:attribute name="process">LAToCBuilder</xsl:attribute>
            <xsl:choose>
              <xsl:when test="/LEGDOC/docinfo/docinfo:custom-metafields/docinfo:custom-metafield[@name='is-first-document-in-enactment'] = 'true'">
                <proc:param name="firstLegisItem" value="true"/>
              </xsl:when>
              <xsl:otherwise>
                <proc:param name="firstLegisItem" value="false"/>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:choose>
              <xsl:when test="/LEGDOC/docinfo/docinfo:custom-metafields/docinfo:custom-metafield[@name='is-last-document-in-enactment'] = 'true'">
                <proc:param name="lastLegisItem" value="true"/>
              </xsl:when>
              <xsl:otherwise>
                <proc:param name="lastLegisItem" value="false"/>
              </xsl:otherwise>
            </xsl:choose>
          </proc:processinginfo>
        </xsl:if>
        <!--			<xsl:if test=" $streamID = ( 'CA06' , 'CA07' , 'CA08' ) ">
    				<xsl:apply-templates select="descendant::docinfo:hierlev[ @exclude-from-displayunits = 'true' ][1]/@exclude-from-displayunits"/>
    			</xsl:if>-->
        <xsl:apply-templates select="@* | node()"/>
      </doc:hier>
    </xsl:template>
    Template docinfo:hier[$streamID = ('CA05','CA06', 'CA07', 'CA08', 'CA10')]
    Documentation

    Description

     @Vikas Gupta: Template to match the docinfo:hier for the $streamID ='CA06','CA07','CA08' 	
    Namespace No namespace
    Match docinfo:hier[$streamID = ('CA05','CA06', 'CA07', 'CA08', 'CA10')]
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="docinfo:hier[$streamID = ('CA05','CA06', 'CA07', 'CA08', 'CA10')]">
      <!--  Original Target XPath:  doc:hier   -->
      <xsl:variable name="dpsi_value">
        <xsl:value-of select="//docinfo:custom-metafield[@name = 'dpsi']"/>
      </xsl:variable>
      <xsl:variable name="dpsi_value_CA10">
        <xsl:value-of select="substring(/COMMENTARYDOC/docinfo/docinfo:doc-id,1,4)"/>
      </xsl:variable>
      <doc:hier>
        <!--  @SBy:  process the first descendant docinfo:hierlev/@exclude-from-displayunits where that attribute is true.  So if this attribute appears on any docinfo:hierlev and is true, then @includeintoc will be set to false  -->
        <xsl:choose>
          <xsl:when test="($dpsi_value = $Title_Dpsi_Code//@key) and $streamID!=('CA06', 'CA07', 'CA08')">
            <doc:hierlev>
              <heading>
                <title>
                  <xsl:value-of select="key('dpsititle', //docinfo:custom-metafield[@name = 'dpsi'], $Title_Dpsi_Code)/@value"/>
                </title>
              </heading>
              <xsl:apply-templates select="descendant::docinfo:hierlev[@exclude-from-displayunits = 'true'][1]/@exclude-from-displayunits"/>
              <xsl:apply-templates select="@* | node()"/>
            </doc:hierlev>
          </xsl:when>
          <xsl:when test="($dpsi_value = $Title_Dpsi_Code_CA05//@key) and $streamID='CA05'">
            <doc:hierlev>
              <heading>
                <title>
                  <xsl:value-of select="key('dpsititle', //docinfo:custom-metafield[@name = 'dpsi'], $Title_Dpsi_Code_CA05)/@value"/>
                </title>
              </heading>
              <xsl:apply-templates select="descendant::docinfo:hierlev[@exclude-from-displayunits = 'true'][1]/@exclude-from-displayunits"/>
              <xsl:apply-templates select="@* | node()"/>
            </doc:hierlev>
          </xsl:when>
          <xsl:when test="($dpsi_value = $Title_Dpsi_Code_CA10//@key or $dpsi_value_CA10=$Title_Dpsi_Code_CA10//@key) and $streamID='CA10'">
            <doc:hierlev>
              <heading>
                <title>
                  <xsl:value-of select="key('dpsititle', substring(/COMMENTARYDOC/docinfo/docinfo:doc-id,1,4), $Title_Dpsi_Code_CA10)/@value"/>
                </title>
              </heading>
              <xsl:apply-templates select="descendant::docinfo:hierlev[@exclude-from-displayunits = 'true'][1]/@exclude-from-displayunits"/>
              <xsl:apply-templates select="@* | node()"/>
            </doc:hierlev>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="descendant::docinfo:hierlev[@exclude-from-displayunits = 'true'][1]/@exclude-from-displayunits"/>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:otherwise>
        </xsl:choose>
      </doc:hier>
    </xsl:template>
    Template docinfo:hier[$streamID = 'CA01']
    Documentation

    Description

     @Vikas Rohilla: Template to match the docinfo:hier for the $streamID ='CA01' 	
    Namespace No namespace
    Match docinfo:hier[$streamID = 'CA01']
    Mode #default
    References
    Variables
    Parameter
    Key
    Import precedence 0
    Source
    <xsl:template match="docinfo:hier[$streamID = 'CA01']">
      <xsl:variable name="dpsi_value">
        <xsl:value-of select="$dpsi"/>
      </xsl:variable>
      <doc:hier>
        <xsl:choose>
          <xsl:when test="$dpsi_value = $Title_Dpsi_Code//@key">
            <doc:hierlev>
              <heading>
                <title>
                  <xsl:value-of select="key('dpsititle', $dpsi_value, $Title_Dpsi_Code)/@value"/>
                </title>
              </heading>
              <xsl:apply-templates select="node() | @*"/>
            </doc:hierlev>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="node() | @*"/>
          </xsl:otherwise>
        </xsl:choose>
      </doc:hier>
    </xsl:template>
    Template docinfo:hier[$streamID = 'CA09']
    Namespace No namespace
    Match docinfo:hier[$streamID = 'CA09']
    Mode #default
    References
    Variables
    Parameter
    Key
    Import precedence 0
    Source
    <xsl:template match="docinfo:hier[$streamID = 'CA09']">
      <xsl:variable name="dpsi_value">
        <xsl:value-of select="$dpsi"/>
      </xsl:variable>
      <doc:hier>
        <xsl:choose>
          <xsl:when test="$dpsi_value = $Title_Dpsi_Code//@key">
            <doc:hierlev>
              <heading>
                <title>
                  <xsl:value-of select="key('dpsititle', $dpsi_value, $Title_Dpsi_Code)/@value"/>
                </title>
              </heading>
              <xsl:apply-templates select="@* | node()"/>
            </doc:hierlev>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="@* | node()"/>
          </xsl:otherwise>
        </xsl:choose>
      </doc:hier>
    </xsl:template>
    Template docinfo:hierlev
    Namespace No namespace
    Match docinfo:hierlev
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev">
      <!--  Original Target XPath:  doc:hier/doc:hierlev   -->
      <doc:hierlev>
        <!--  @SBy:  @exclude-from-displayunits already taken care of in creating doc:hier/@includeintoc   -->
        <xsl:apply-templates select="@* except @exclude-from-displayunits"/>
        <xsl:apply-templates select="node()"/>
        <xsl:apply-templates select="following-sibling::*[1][self::docinfo:hierlev]" mode="hierlevSibling"/>
      </doc:hierlev>
    </xsl:template>
    Template docinfo:hierlev[preceding-sibling::docinfo:hierlev]hierlevSibling
    Namespace No namespace
    Match docinfo:hierlev[preceding-sibling::docinfo:hierlev]
    Mode hierlevSibling
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev[preceding-sibling::docinfo:hierlev]" mode="hierlevSibling">
      <doc:hierlev>
        <xsl:apply-templates select="@* except @exclude-from-displayunits"/>
        <xsl:apply-templates select="node()"/>
        <xsl:apply-templates select="*[1][self::docinfo:hierlev]" mode="hierlevSibling"/>
      </doc:hierlev>
    </xsl:template>
    Template docinfo:hierlev[preceding-sibling::docinfo:hierlev]
    Namespace No namespace
    Match docinfo:hierlev[preceding-sibling::docinfo:hierlev]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev[preceding-sibling::docinfo:hierlev]"/>
    Template docinfo:hierlev/@display-name[$streamID = ('UK06','UK07')]
    Documentation

    Description

     Sudhanshu Srivastava : Handling attribute @display-name for UK06 
    Namespace No namespace
    Match docinfo:hierlev/@display-name[$streamID = ('UK06','UK07')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev/@display-name[$streamID = ('UK06','UK07')]">
      <xsl:if test=". = 'act'">
        <xsl:attribute name="leveltype" select="'act'"/>
      </xsl:if>
      <xsl:if test=". = 'SI'">
        <xsl:attribute name="leveltype" select="'instrument'"/>
      </xsl:if>
      <xsl:if test=". = 'measure'">
        <xsl:attribute name="leveltype" select="'measure'"/>
      </xsl:if>
    </xsl:template>
    Template docinfo:hierlev/@role
    Documentation

    Description

    			***		@SBy:  These requirements are covered via other modules:      ***
    
    			<li><sourcexml>docinfo:hier/docinfo:hierlev/heading</sourcexml> becomes
    					<targetxml>doc:hier/doc:hierlev/heading</targetxml>
    			</li>
    			<li><sourcexml>docinfo:hier/docinfo:hierlev/heading/title</sourcexml> becomes
    					<targetxml>doc:hier/doc:hierlev/heading/title</targetxml>
    			</li>  
    	
    Namespace No namespace
    Match docinfo:hierlev/@role
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev/@role"/>
    Template docinfo:hierlev/heading/title/nl[$streamID = ('CA06', 'CA07')]
    Namespace No namespace
    Match docinfo:hierlev/heading/title/nl[$streamID = ('CA06', 'CA07')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev/heading/title/nl[$streamID = ('CA06', 'CA07')]">
      <!--  @SBy:  note that otherwise nl will become proc:nl which is permitted within title   -->
      <xsl:text> </xsl:text>
    </xsl:template>
    Template docinfo:hierlev/@exclude-from-displayunits[. = 'true']
    Namespace No namespace
    Match docinfo:hierlev/@exclude-from-displayunits[. = 'true']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev/@exclude-from-displayunits[. = 'true']">
      <!--  Original Target XPath:  doc:hier/@includeintoc="false"   -->
      <xsl:attribute name="includeintoc" select="'false'"/>
    </xsl:template>
    Template docinfo:hierlev/heading/title/num[$streamID = 'CA09']
    Documentation

    Description

    xsl:template match="docinfo:hierlev/@exclude-from-displayunits[ . != 'true' ]"/
    Namespace No namespace
    Match docinfo:hierlev/heading/title/num[$streamID = 'CA09']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev/heading/title/num[$streamID = 'CA09']">
      <!--  @SBy:  note that otherwise num will become num which is permitted within title   -->
      <!--  Original Target XPath:  doc:hierdoc:hierlevheadingtitle   -->
      <xsl:apply-templates select="@* | node()"/>
    </xsl:template>
    Template docinfo:hierlev[$streamID = 'CA13']/heading
    Documentation

    Description

     Sudhanshu Srivastava: create template for handling docinfo:hierlev for CA13. 
    Namespace No namespace
    Match docinfo:hierlev[$streamID = 'CA13']/heading
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev[$streamID = 'CA13']/heading">
      <heading>
        <xsl:apply-templates select="@* | node()"/>
      </heading>
    </xsl:template>
    Template docinfo:hierlev[$streamID = 'CA13']/heading/title
    Namespace No namespace
    Match docinfo:hierlev[$streamID = 'CA13']/heading/title
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:hierlev[$streamID = 'CA13']/heading/title">
      <title>
        <xsl:apply-templates select="@* | node()"/>
      </title>
    </xsl:template>
    Template inlineobject[ancestor::docinfo:hierlev]
    Namespace No namespace
    Match inlineobject[ancestor::docinfo:hierlev]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="inlineobject[ancestor::docinfo:hierlev]"/>
    Template docinfo:lbu-indexing-terms
    Documentation

    Description

    Instructions [common element]

    docinfo:lbu-indexing-terms/docinfo:lbu-subj becomes classify:classification[@classscheme="lbu-subj"]/classify:classitem/classify:classitem-identifier/classify:classcode[@normval]. The content of docinfo:lbu-subj becomes the value for classify:classcode[@normval].

    Source XML

    
    <docinfo:lbu-indexing-terms>
        <docinfo:lbu-subj>lawnow160</docinfo:lbu-subj>
    </docinfo:lbu-indexing-terms            
    
    	

    Target XML

    
    <classify:classification classscheme="lbu-subj">
        <classify:classitem>
            <classify:classitem-identifier>
                <classify:classcode normval="lawnow160"/>
            </classify:classitem-identifier>
        </classify:classitem>
    </classify:classification>
    
    	

    Note: If source document having multiple docinfo:lbu-subj within docinfo:lbu-indexing-terms, then each subsequent occurrence of the element docinfo:lbu-subj will becomes classify:classitem/classify:classitem-identifier/classify:classcode[@normval] element.

    Source XML

    
    <docinfo:lbu-indexing-terms>
        <docinfo:lbu-subj>lawnowl60</docinfo:lbu-subj>
        <docinfo:lbu-subj>lawnow295</docinfo:lbu-subj>
    </docinfo:lbu-indexing-terms>            
    
    	

    Target XML

    
    <classify:classification classscheme="lbu-subj">
        <classify:classitem>
            <classify:classitem-identifier>
                <classify:classcode normval="lawnow160"/>
            </classify:classitem-identifier>
        </classify:classitem>
        <classify:classitem>
            <classify:classitem-identifier>
                <classify:classcode normval="lawnow295"/>
            </classify:classitem-identifier>
        </classify:classitem>
    </classify:classification>
    
    	

    Description

     rosetta element: docinfo:lbu-indexing-terms 
     <topicref href="../../common_newest/Rosetta_docinfo.lbu-indexing-terms-LxAdv-classify.classification_classscheme_lbu-subj-scheme.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.lbu-indexing-terms-LxAdv-classify.classification_classscheme_lbu-subj-scheme.dita  
    <xsl:message>Rosetta_docinfo.lbu-indexing-terms-LxAdv-classify.classification_classscheme_lbu-subj-scheme.xsl requires manual development!</xsl:message> 
     CSN: Added docinfo:lbu-indexing-terms from base.xsl. 
    Namespace No namespace
    Match docinfo:lbu-indexing-terms
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:lbu-indexing-terms">
      <xsl:if test="child::docinfo:lbu-juris">
        <xsl:element name="classify:classification">
          <xsl:attribute name="classscheme">docinfo:lbu-juris</xsl:attribute>
          <xsl:apply-templates select="child::docinfo:lbu-juris"/>
        </xsl:element>
      </xsl:if>
      <xsl:if test="child::docinfo:lbu-subj">
        <xsl:element name="classify:classification">
          <xsl:attribute name="classscheme">lbu-subj</xsl:attribute>
          <xsl:apply-templates select="child::docinfo:lbu-subj"/>
        </xsl:element>
      </xsl:if>
    </xsl:template>
    Template docinfo:lbu-subj
    Namespace No namespace
    Match docinfo:lbu-subj
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:lbu-subj">
      <xsl:element name="classify:classitem">
        <xsl:element name="classify:classitem-identifier">
          <xsl:element name="classify:classcode">
            <xsl:attribute name="normval">
              <xsl:value-of select="."/>
            </xsl:attribute>
          </xsl:element>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template docinfo:lbu-juris[not($streamID='CA01')]
    Namespace No namespace
    Match docinfo:lbu-juris[not($streamID='CA01')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:lbu-juris[not($streamID='CA01')]">
      <xsl:element name="classify:classitem">
        <xsl:element name="classify:classitem-identifier">
          <xsl:element name="classify:classcode">
            <xsl:attribute name="normval">
              <xsl:value-of select="."/>
            </xsl:attribute>
          </xsl:element>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template docinfo:lbu-juris[$streamID='CA01'][.!='CA' or .!='UK' or .!='NZ']
    Documentation

    Description

     Vikas Rohilla : Updated as per the $streamID CA01    
    Namespace No namespace
    Match docinfo:lbu-juris[$streamID='CA01'][.!='CA' or .!='UK' or .!='NZ']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:lbu-juris[$streamID='CA01'][.!='CA' or .!='UK' or .!='NZ']">
      <xsl:element name="classify:classitem">
        <xsl:element name="classify:classitem-identifier">
          <xsl:element name="classify:classname">
            <xsl:value-of select="."/>
          </xsl:element>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template docinfo:lbu-meta
    Documentation

    Description

    Instructions [common element]

    docinfo:lbu-meta becomes doc:legacy-metadata[@metadatasource="lbu-meta"]. docinfo:metaitem becomes meta/metaitem. The source attribute @name becomes metaitem[@name] and @value becomes metaitem[@value].

    docinfo:metaitem should be dropped if the attribute @name has any of the following drop list values:

    • @name="date"
    • @name="juris"
    • @name="court"
    • @name="country"
    • @name="parent-filename"

    Source XML 1

    	<docinfo>
    	<docinfo:lbu-meta>
    		<docinfo:metaitem name="date" value="18810104"/>
    		<docinfo:metaitem name="country" value="2"/>
    		<docinfo:metaitem name="court" value="2"/>
    		<docinfo:metaitem name="date" value="18810104"/>
    		<docinfo:metaitem name="juris" value="9"/>
    		<docinfo:metaitem name="court" value="1"/>
    		<docinfo:metaitem name="country" value="2"/>
    		<docinfo:metaitem name="lbu-sourcename" value="New Zealand Law Reports"/>
    		<docinfo:metaitem name="parent-docid" value="1NZLR_CA_1"/>
    		<docinfo:metaitem name="parent-filename" value="1NZLR_CA_00001.xml"/>
    	</docinfo:lbu-meta></docinfo>
    	
    		

    Target XML 1

    	<doc:metadata>
    	<doc:docinfo>
    		<doc:legacy-metadata metadatasource="lbu-meta">
    			<meta>
    			   <metaitem name="lbu-sourcename" value="New Zealand Law Reports"/>
    			   <metaitem name="parent-docid" value="1NZLR_CA_1"/>
    			</meta>
    		</doc:legacy-metadata>
    	</doc:docinfo></doc:metadata>
    	
    		

    Source XML 2

    	<docinfo>
    	<docinfo:lbu-meta>
    	<docinfo:metaitem name="SRCNAME" value="AGAA"></docinfo:metaitem>
    	<docinfo:metaitem name="SRCDOCNO" value="00000008"></docinfo:metaitem>
    	<docinfo:metaitem name="DPSI" value="03EN"></docinfo:metaitem>
    	</docinfo:lbu-meta>
    	</docinfo>
    	
    		

    Target XML 2

    	<doc:metadata>
    	<doc:docinfo>
    		<doc:legacy-metadata metadatasource="lbu-meta">
    			<meta>
    			   <metaitem name="SRCNAME" value="AGAA"/>
    			   <metaitem name="SRCDOCNO" value="00000008"/>
    			   <metaitem name="DPSI" value="03EN"/>
    			</meta>
    		</doc:legacy-metadata>
    	</doc:docinfo></doc:metadata>
    	
    		

    Source XML 3

    	<docinfo>
    	<docinfo:lbu-meta>
    	<docinfo:metaitem name="QLDB" value="sb99"></docinfo:metaitem>
    	</docinfo:lbu-meta>
    	</docinfo>
    	
    		

    Target XML 3

    	<doc:metadata>
    	<doc:docinfo>
    		<doc:legacy-metadata metadatasource="lbu-meta">
    			<meta>
    			   <metaitem name="QLDB" value="sb99"/>	       
    			</meta>
    		</doc:legacy-metadata>
    	</doc:docinfo></doc:metadata>
    	
    		

    Source XML 4

    	
    	<docinfo>
    	 <!-- ETC. -->
    	 <docinfo:lbu-meta>
    	  <docinfo:metaitem name="selection_criteria_variant" value="PCT207_regulation_1" />
    	  <docinfo:metaitem name="lbu-sourcename" value="New Zealand Regulations" />
    	  <docinfo:metaitem name="parent-docid" value="GCG-REGULATIONS-D" />
    	  <docinfo:metaitem name="parent-filename" value="Regs-D.xml" />
    	  <docinfo:metaitem name="parent-docid" value="NZREGS_REGS-D.SGM_2001R326-FRONT-CONTENTS" />
    	  <docinfo:metaitem name="parent-filename" value="Regs-D1030.xml" />
    	 </docinfo:lbu-meta>
    	 <!-- ETC. -->
    	</docinfo>
    				

    Target XML 4

    					
    	<doc:metadata>
    	<doc:docinfo>
    		<doc:legacy-metadata metadatasource="lbu-meta">
    			<meta>
    			   <metaitem name="selection_criteria_variant" value="PCT207_regulation_1"/>
    			   <metaitem name="lbu-sourcename" value="New Zealand Regulations"/>
    			   <metaitem name="parent-docid" value="GCG-REGULATIONS-D"/>
    			   <metaitem name="parent-docid" value="NZREGS_REGS-D.SGM_2001R326-FRONT-CONTENTS"/>
    			</meta>
    		</doc:legacy-metadata>
    	</doc:docinfo></doc:metadata>
    	
    				

    Description

     rosetta element: docinfo:lbu-meta 
     <topicref href="../../common_newest/Rosetta_docinfo.lbu-meta-LxAdv-doc.legacy-metadata_metadatasource_lbu-meta-scheme.dita"/> 
    Namespace No namespace
    Match docinfo:lbu-meta
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:lbu-meta">
      <xsl:apply-templates/>
    </xsl:template>
    Template docinfo:metaitem
    Namespace No namespace
    Match docinfo:metaitem
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:metaitem">
      <xsl:choose>
        <xsl:when test="@name='date' or      @name='juris' or      @name='court' or      @name='country' or      @name='parent-filename' or      @name='PA-PGUID' or      @name='TOPIC-PGUID' or      @name='SUB-TOPIC-PGUID'         "/>
        <xsl:otherwise>
          <!-- @name='parent-docid'and name='lbu-sourcename' are two values that need to be converted for court cases -->
          <metaitem>
            <xsl:attribute name="name">
              <xsl:value-of select="@name"/>
            </xsl:attribute>
            <xsl:attribute name="value">
              <xsl:value-of select="@value"/>
            </xsl:attribute>
          </metaitem>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template docinfo:load-date
    Documentation

    Description

    Instructions [common element]

    docinfo:load-date/date becomes dc:metadata/dc:date[@lnmeta:datetype="load-date"].

    Note: The format of the content of all dc:date elements must be in 'YYYY-MM-DD'.

    Source XML

    
    <docinfo:load-date>
    <date day="01" month="01" year="2006">01 January 2006</date>
    </docinfo:load-date>
    
    		

    Target XML

    
    <dc:date lnmeta:datetype="load-date">2006-01-01</dc:date>
    
    		

    Note:

    The below example encountered in CANADA contents which contains "00" value in @day="00" and @month="00" attributes.

    Per LBU- This was the format used for historical data in which only the year was given. We will remediate the content to have a valid month/day and will send the remediated data in a subsequent reload.

    
    <docinfo:load-date>
        <date year="1959" month="00" day="00">19590000</date>
    </docinfo:load-date>
                    
    				

    Description

     rosetta element: docinfo:load-date 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_date-Chof-docinfo.load-date-LxAdv-dc.date_lnmeta.datetype_load-date-scheme.dita  
    Namespace No namespace
    Match docinfo:load-date
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:load-date">
      <xsl:apply-templates/>
    </xsl:template>
    Template docinfo:load-date/date
    Namespace No namespace
    Match docinfo:load-date/date
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:load-date/date">
      <dc:date lnmeta:datetype="load-date">
        <xsl:value-of select="@year"/>
        <xsl:text>-</xsl:text>
        <xsl:value-of select="@month"/>
        <xsl:text>-</xsl:text>
        <xsl:value-of select="@day"/>
      </dc:date>
    </xsl:template>
    Template docinfo:overview
    Documentation

    Description

    Instructions [common element]

    docinfo:overview becomes doc:overview, with child doc:overview/bodytext created to hold the converted docinfo:overview content.

    If docinfo:overview has attribute @type then retain and carry into the target xml doc:overview/@type as shown below.

    (i.e docinfo:overview type="extracted" becomes doc:overview type="extracted").

    Note: Conversion needs to suppress docinfo:overview when it's the child of leg:levelinfo and levelinfo. This will be applicable to all Pacific Content Streams.

    Source XML

     <docinfo> <docinfo:overview type="editorial"> <p>
              <text>This is a document transactional overview sample for AU05 Commentary Form
              content type/stream. It is indicative text only and not a sample of actual text that will
              be included but used here to identify the particular element used for this
              purpose.</text> </p> </docinfo:overview> </docinfo> 

    Target XML

     <doc:docinfo> <doc:overview type="editorial"> <bodytext>
              <p> <text>This is a document transactional overview sample for AU05 Commentary
              Form content type/stream. It is indicative text only and not a sample of actual text that
              will be included but used here to identify the particular element used for this
              purpose.</text> </p> </bodytext> </doc:overview>
              </doc:docinfo> 

    Note: For UK streams : If input documents is having docinfo:overview@type markup with attribute value "abstract" then conversion needs to mapped doc:overview@type="abstract" in NewLexis target. Refer input and target examples;

    Source XML

     <docinfo> <docinfo:overview type="abstract"> <p>
              <text>VAT – default surcharge – reasonable excuse – dismissal of key employee –
              reliance on another person</text> </p> </docinfo:overview>
              </docinfo> 

    Target XML

     <doc:docinfo> <doc:overview type="abstract"> <bodytext>
              <p> <text>VAT – default surcharge – reasonable excuse – dismissal of key
              employee – reliance on another person</text> </p> </bodytext>
              </doc:overview> </doc:docinfo> 

    Description

     rosetta element: docinfo:overview 
     <topicref href="../../common_newest/Rosetta_docinfo.overview-LxAdv-docinfo.overview.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.overview-LxAdv-docinfo.overview.dita  
     CSN: Added docinfo:overview from base.xsl. 
    Namespace No namespace
    Match docinfo:overview
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:overview">
      <xsl:choose>
        <xsl:when test="(parent::levelinfo or parent::leg:levelinfo) and (//docinfo:doc-country/@iso-cc = 'NZ' or //docinfo:doc-country/@iso-cc = 'AU')"/>
        <xsl:otherwise>
          <xsl:element name="doc:overview">
            <xsl:attribute name="type">
              <xsl:value-of select="@type"/>
            </xsl:attribute>
            <xsl:choose>
              <xsl:when test="bodytext">
                <xsl:apply-templates select="node()"/>
              </xsl:when>
              <xsl:otherwise>
                <bodytext>
                  <xsl:apply-templates select="node()"/>
                </bodytext>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template docinfo:selector[preceding-sibling::docinfo:selector]
    Documentation

    Description

    Instructions [common element]

    docinfo:selector becomes classify:classification[@classscheme="selector"]/classify:classitem/classify:classitem-identifier/classify:classname. Each subsequent occurrence of the element docinfo:selector adds a sibling /classify:classitem/classify:classitem-identifier/classify:classname element.

    Source XML

    
    <docinfo:selector>act</docinfo:selector>
    
    	

    Target XML

    
    <classify:classification classscheme="selector">
    <classify:classitem>
    <classify:classitem-identifier>
    <classify:classname>act</classify:classname>
    </classify:classitem-identifier>
    </classify:classitem>
    </classify:classification>
    
    	

    Description

     rosetta element: docinfo:selector 
     <topicref href="../../common_newest/Rosetta_docinfo.selector-LxAdv-classify.classification_classscheme_selector-scheme.dita"/> 
    Namespace No namespace
    Match docinfo:selector[preceding-sibling::docinfo:selector]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:selector[preceding-sibling::docinfo:selector]"/>
    Template docinfo:selector
    Namespace No namespace
    Match docinfo:selector
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:selector">
      <classify:classitem>
        <classify:classitem-identifier>
          <classify:classname>
            <xsl:apply-templates/>
          </classify:classname>
        </classify:classitem-identifier>
      </classify:classitem>
      <xsl:for-each select="following-sibling::docinfo:selector">
        <classify:classitem>
          <classify:classitem-identifier>
            <classify:classname>
              <xsl:apply-templates/>
            </classify:classname>
          </classify:classitem-identifier>
        </classify:classitem>
      </xsl:for-each>
    </xsl:template>
    Template docinfo:subtype
    Documentation

    Description

    Instructions [common element]

    docinfo:subtype becomes doc:legacy-metadata/meta/metaitem with attributes @name="docinfo:subtype" and value will be the data from docinfo:subtype.

    Source XML

    
    <docinfo:subtype>cait</docinfo:subtype>
    <docinfo:subtype>cait</docinfo:subtype>
    
    	

    Target XML

    
    <doc:legacy-metadata metadatasource="lbu-meta">
    <meta>
        <metaitem name="docinfo:subtype" value="cait"/>
        <metaitem name="docinfo:subtype" value="cait"/>
    </meta>
    </doc:legacy-metadata>
    
    	

    Description

     CSN: Added docinfo:selector from base.xsl. 
    <xsl:template xmlns="http://dita.oasis-open.org/architecture/2005/" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" match="docinfo:selector">
    				<xsl:element name="classify:classitem">
    					<xsl:element name="classify:classitem-identifier">
    						<xsl:element name="classify:classname">
    							<xsl:apply-templates/>
    						</xsl:element>
    					</xsl:element>
    				</xsl:element>
    			</xsl:template>
     rosetta element: docinfo:subtype 
     <topicref href="../../common_newest/Rosetta_docinfo.subtype-LxAdv-doc.legacy-metadata_metadatasource_lbu-meta-scheme.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.subtype-LxAdv-doc.legacy-metadata_metadatasource_lbu-meta-scheme.dita  
     CSN: Added docinfo:subtype from base.xsl. 
    Namespace No namespace
    Match docinfo:subtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:subtype">
      <xsl:element name="metaitem">
        <xsl:attribute name="name">
          <xsl:text>docinfo:subtype</xsl:text>
        </xsl:attribute>
        <xsl:attribute name="value">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:element>
    </xsl:template>
    Template docinfo:topiccodes
    Documentation

    Description

    Instructions [common element]

    docinfo:topiccodes/docinfo:topiccode becomes classify:classification[@classscheme="docinfo:topiccodes"]/classify:classitem/classify:classitem-identifier/classify:classcode/@normval. The content of docinfo:topiccode becomes the value for classify:classcode/@normval. A single classify:classification[@classscheme="docinfo:topiccodes"] is created for each unique value of @classscheme. Within this single element, create multiple classify:classitem elements. Only create additional classify:classification wrapper elements when the classify:classification[@classscheme] has different values.

    Source XML

     <docinfo:topiccodes>
    					<docinfo:topiccode>#PA#CODE#</docinfo:topiccode>
    					<docinfo:topiccode>#PA#BUSM#</docinfo:topiccode>
    					</docinfo:topiccodes> 

    Target XML

     <classify:classification classscheme="docinfo:topiccodes">
    					<classify:classitem> <classify:classitem-identifier>
    					<classify:classcode normval="#PA#CODE#"/>
    					</classify:classitem-identifier> </classify:classitem>
    					<classify:classitem> <classify:classitem-identifier>
    					<classify:classcode normval="#PA#BUSM#"/>
    					</classify:classitem-identifier> </classify:classitem>
    					</classify:classification> 

    Note: Applied for UK07 Regulation contents only: When element docinfo:topiccode contains attribute @scheme="source-by-date", then conversion will suppress it including its contents as well. Please see below input and output examples for more details:

    Source XML:

     <docinfo:topiccodes> <docinfo:topiccode
    					scheme="source-by-date">2012-08-02</docinfo:topiccode>
    					<docinfo:topiccode>#PA#CODE#</docinfo:topiccode>
    					</docinfo:topiccodes> 

    Target XML(Only second docinfo:topiccode) converted

     <classify:classification classscheme="docinfo:topiccodes">
    					<classify:classitem> <classify:classitem-identifier>
    					<classify:classcode normval="#PA#CODE#"/>
    					</classify:classitem-identifier> </classify:classitem>
    					</classify:classification> 

    Description

     Old file: common_rosetta_docinfo.topiccodes.dita 
     <topicref href="../../common_newest/Rosetta_docinfo.topiccodes-to-LxAdv-classify.classification_classscheme_docinfo-topiccodes.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.topiccodes-to-LxAdv-classify.classification_classscheme_docinfo-topiccodes.dita  
     CSN: Added docinfo:topiccodes and docinfo:topiccode from base.xsl. 
    Namespace No namespace
    Match docinfo:topiccodes
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:topiccodes">
      <xsl:element name="classify:classification">
        <xsl:attribute name="classscheme">docinfo:topiccodes</xsl:attribute>
        <xsl:apply-templates/>
      </xsl:element>
    </xsl:template>
    Template docinfo:topiccode
    Namespace No namespace
    Match docinfo:topiccode
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:topiccode">
      <xsl:element name="classify:classitem">
        <xsl:element name="classify:classitem-identifier">
          <xsl:element name="classify:classcode">
            <xsl:attribute name="normval">
              <xsl:value-of select="."/>
            </xsl:attribute>
          </xsl:element>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template docinfo:versioninfo
    Documentation

    Description

    Instructions [common element]

    docinfo:versioninfo/@hasotheversions becomes doc:versioninfo/@hasotherversions with these children:

    • docinfo:versioninfo/docinfo:startdate[@day @month @year] becomes doc:versioninfo/doc:startdate[@day @month @year].
    • docinfo:versioninfo/docinfo:enddate[@day @month @year] becomes doc:versioninfo/doc:enddate[@day @month @year].
    • docinfo:versioninfo/docinfo:versionbranch[@value] becomes doc:versioninfo/doc:versionbranch[@value].

    Note:

    Added the attribute @normdate (value must be in 'YYYY-MM-DD') inside the target doc:startdate and doc:enddate elements.

    • If one or more of the three date values (year, month or day) are absent, then attribute @normdate should not be populated.
    • The @normdate attribute value shoud be generated from target attributes (@year, @month and @day), which are comes under the doc:startdate and doc:enddate elements within New Lexis.

    Note:

    Added the mapping of @startdate-tbd attribute which is comes under docinfo:versioninfo element in source then it should be mapped in target doc:versioninfo@startdate-tbd (attribute value must be in 'true' OR 'false', default value is 'false').

    For CA05 Acts&Bills and CA08 Constitutions, suppress docinfo:versioninfo from conversion if it has the following variations:

    • <docinfo:versioninfo></docinfo:versioninfo>
    • <docinfo:versioninfo hasotherversions="false"></docinfo:versioninfo>
    • <docinfo:versioninfo hasotherversions="true"></docinfo:versioninfo>
    The above variations should be considered as "empty" and needs to be suppressed from conversion.

    When transforming the attribute values, enforce these constraints:

    • The @day value must be two digit number, i.e. from '01' to '31'.
    • The @month value must be transformed to a two digit number from '01' to '12', i.e. 'January' = '01' and 'December' = '12'.
    • The @year value must be a four digit number, i.e. '2011'.

    Note: Exception for Canada: Conversion should generate @day attribute value in sequential digit. No need to add leading zero (0) to make the value in two digits.

    Source XML based on Canada stream:

    
    <docinfo:versioninfo hasotherversions="true">
        <docinfo:startdate day="01" month="01" year="2003"/>
        <docinfo:enddate day="30" month="06" year="2003"/>
    </docinfo:versioninfo>
    

    Target XML

    
    <doc:versioninfo hasotherversions="true">
        <doc:startdate day="1" month="01" year="2003"/>
        <doc:enddate day="30" month="06" year="2003"/>
    </doc:versioninfo>
    
    	

    Source XML

    
    <docinfo:versioninfo hasotherversions="true">
         <docinfo:startdate year="2007" month="06" day="21"/>
         <docinfo:versionbranch value="1120669"/>
    </docinfo:versioninfo>
    
    	

    Target XML

    
    <doc:versioninfo hasotherversions="true">
        <doc:startdate month="06" day="21" year="2007"/>
        <doc:versionbranch value="1120669"/>
    </doc:versioninfo>
    
    	

    Description

     rosetta element: docinfo:versioninfo 
     <topicref href="../../common_newest/Rosetta_docinfo.versioninfo-LxAdv-doc.versioninfo-scheme.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.versioninfo-LxAdv-doc.versioninfo-scheme.dita  
     CSN: Created docinfo:versioninfo, docinfo:startdate, docinfo:enddate. 
    Namespace No namespace
    Match docinfo:versioninfo
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="docinfo:versioninfo">
      <xsl:choose>
        <xsl:when test="$streamID=('CA05' , 'CA08') and not(child::*)"/>
        <xsl:otherwise>
          <xsl:element name="doc:versioninfo">
            <xsl:apply-templates select="@*|node()"/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template docinfo:versioninfo/@hasotherversions | docinfo:versionbranch/@value | docinfo:versioninfo/@startdate-tbd
    Namespace No namespace
    Match docinfo:versioninfo/@hasotherversions | docinfo:versionbranch/@value | docinfo:versioninfo/@startdate-tbd
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:versioninfo/@hasotherversions | docinfo:versionbranch/@value | docinfo:versioninfo/@startdate-tbd">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template docinfo:startdate
    Namespace No namespace
    Match docinfo:startdate
    Mode #default
    References
    Template
    Import precedence 0
    Source
    <xsl:template match="docinfo:startdate">
      <xsl:element name="doc:startdate">
        <xsl:call-template name="dateAtts"/>
      </xsl:element>
    </xsl:template>
    Template docinfo:enddate
    Namespace No namespace
    Match docinfo:enddate
    Mode #default
    References
    Template
    Import precedence 0
    Source
    <xsl:template match="docinfo:enddate">
      <xsl:element name="doc:enddate">
        <xsl:call-template name="dateAtts"/>
      </xsl:element>
    </xsl:template>
    Template docinfo:versionbranch
    Namespace No namespace
    Match docinfo:versionbranch
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="docinfo:versionbranch">
      <xsl:element name="doc:versionbranch">
        <xsl:apply-templates select="@*"/>
      </xsl:element>
    </xsl:template>
    Template dateAtts
    Namespace No namespace
    Used by
    Import precedence 0
    Source
    <xsl:template name="dateAtts">
      <xsl:variable name="dayValue" as="xs:integer">
        <xsl:choose>
          <xsl:when test="@day">
            <xsl:value-of select="xs:integer(@day)"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>0</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="monthValue" as="xs:integer">
        <xsl:choose>
          <xsl:when test="@month">
            <xsl:value-of select="xs:integer(@month)"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>0</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="monthValueString" as="xs:string" select="if ($monthValue lt 10 and $monthValue gt 0) then concat( '0' , string($monthValue) ) else string($monthValue)"/>
      <xsl:variable name="yearValue" as="xs:integer" select="xs:integer(@year)"/>
      <xsl:variable name="current2digitYear" as="xs:integer" select="xs:integer(substring(string(current-date()),3,2))"/>
      <xsl:variable name="outputDay" as="xs:boolean" select="if ($dayValue gt 0 and $dayValue lt 32) then true() else false()"/>
      <xsl:variable name="outputMonth" as="xs:boolean" select="if ($monthValue gt 0 and $monthValue lt 13) then true() else false()"/>
      <xsl:variable name="outputYear" as="xs:boolean" select="if ($yearValue gt 0) then true() else false()"/>
      <xsl:variable name="dayNorm" as="xs:string" select="if ($dayValue lt 10) then concat( '0' , string($dayValue) ) else string($dayValue)"/>
      <xsl:variable name="yearNorm" as="xs:string" select="if ($yearValue lt 10) then concat( '200' , string($yearValue) ) else             if ($yearValue le $current2digitYear) then concat( '20' , string($yearValue) ) else             if ($yearValue lt 100) then concat( '19' , string($yearValue) ) else             if ($yearValue lt 1000) then concat( '0' , string($yearValue) ) else             string($yearValue)"/>
      <xsl:if test="$outputDay and $outputMonth and $outputYear">
        <xsl:attribute name="day" select="$dayValue"/>
        <xsl:attribute name="normdate" select="concat($yearNorm,'-',$monthValueString,'-',$dayNorm)"/>
      </xsl:if>
      <xsl:if test="$outputMonth and $outputYear">
        <xsl:attribute name="month" select="$monthValueString"/>
      </xsl:if>
      <xsl:if test="$outputYear">
        <xsl:attribute name="year" select="$yearValue"/>
      </xsl:if>
    </xsl:template>
    Template alttitle
    Documentation

    Description

    alttitle becomes alttitle.

    Source XML

    
    <leg:heading>
        <desig searchtype="CHAP-NUM"><designum><refpt id="CPSA.SDCR.SDCR.PT2" type="ext"/>Part II</designum></desig>
        <title searchtype="CHAP-TITLE"> &#x2014; Application of Part I [<emph typestyle="it">Supreme Court Only</emph>]</title>
        <alttitle>Part III &#x2014; The Civil Division &#x2014; Procedures under Special Acts [<emph typestyle="it">District Court Only</emph>]</alttitle>
    </leg:heading>
    
    	

    Target XML

    
    <heading>
        <desig>Part II</desig>
        <title> &#x2014; Application of Part I [<emph typestyle="it">Supreme Court Only</emph>]</title>
        <alttitle>Part III &#x2014; The Civil Division &#x2014; Procedures under Special Acts [<emph typestyle="it">District Court Only</emph>]</alttitle>
    </heading>
    
    	

    Description

     end topichead  Metadata  
    <topichead navtitle="General Markup">
    		<topicref href="../common/common_rosetta_pgrp.dita"/>
    		<topicref href="../common/common_rosetta_p.dita"/>
    		<topicref href="../common/common_rosetta_p-limited.dita"/>
    		<topicref href="../common/common_rosetta_text.dita"/>
    		<topicref href="../common/common_rosetta_form-chars.dita"/>
    		<topicref href="../common/common_rosetta_char-line.dita"/>
    		<topicref href="../common/common_rosetta_emph.dita"/>
    		<topicref href="../common/common_rosetta_page.dita"/>
    		<topicref href="../common/common_rosetta_l.dita"/>
    		<topicref href="../common/common_rosetta_toc.dita"/>
    		<topicref href="../common/common_rosetta_deflist.dita"/>	
    		<topicref href="../common/common_rosetta_refpt.dita"/>
    		<topicref href="../common/common_rosetta_blockquote.dita"/>
    		<topicref href="../common/common_rosetta_legfragment.dita"/>
    		<topicref href="../common/common_rosetta_link.dita"/>
    		<topicref href="../common/common_rosetta_lnlink.dita"/>
    		<topicref href="../common/common_rosetta_insert-line.dita"/>
    		<topicref href="../common/common_rosetta_remotelink.dita"/>
    		<topicref href="../common/common_rosetta_marker.dita"/>
    		<topicref href="../common/common_rosetta_nl.dita"/>
    		<topicref href="../common/common_rosetta_strike.dita"/>
    		<topicref href="../common/common_rosetta_h.dita"/>
    		<topicref href="../common/common_rosetta_heading.dita"/>
    		<topicref href="../common/common_rosetta_title.dita"/>
    		<topicref href="../common/common_rosetta_hrule.dita"/>
    		<topicref href="../common/common_rosetta_inlineobject.dita"/>
    		<topicref href="../common/common_rosetta_figure.dita"/>
    		<topicref href="../common/common_rosetta_dispformula.dita"/>	
    		<topicref href="../common/common_rosetta_pnum.dita"/>
    		<topicref href="../common/common_rosetta_footnote.dita"/>
    		<topicref href="../common/common_rosetta_ci.cite.dita"/>
    		<topicref href="../common/common_rosetta_table.dita"/>
    		<topicref href="../common/common_rosetta_desig.dita"/>
    		<topicref href="../common/common_rosetta_edpnum.dita"/>
    		<topicref href="../common/common_rosetta_subtitle.dita"/>
    		<topicref href="../common/common_rosetta_sup.dita"/>
    		<topicref href="../common/common_rosetta_sub.dita"/>
    		<topicref href="../common/common_rosetta_num_frac.dita"/>
    		<topicref href="../common/common_rosetta_glp.note.dita"/>
    		<topicref href="../common/common_rosetta_sigblock.dita"/>
    		<topicref href="../common/common_rosetta_person.dita"/>
        	<topicref href="../common/common_rosetta_ln.user_displayed.dita"/>
        	<topicref href="../common/common_rosetta_copyright.dita"/>
        	<topicref href="../common/common_rosetta_endnote.dita"/>
        	<topicref href="../common/common_rosetta_credit.dita"/>
        	</topichead>
     start topichead  General Markup  
     rosetta element: alttitle 
     <topicref href="../../common_newest/Rosetta_alttitle-LxAdv-alttitle.dita"/> 
    Namespace No namespace
    Match alttitle
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="alttitle">
      <!--  Original Target XPath:  alttitle   -->
      <alttitle>
        <xsl:apply-templates select="@* | node()"/>
      </alttitle>
    </xsl:template>
    Template blockquote
    Documentation

    Description

    Instructions

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    Please note that the conversion of blockquote must follow specific rules based on its location in the source document. These context sensitive aspects are not all discussed in detail in the general instructions given here. Please see the specific document type instructions for more information regarding the context sensitive conversion details of this element. If there is any contradiction between these general instructions and the document type specific instructions, the specific instructions should be given precedence.

    In general, blockquote becomes blockquote.

    If figure or legfragment occur within blockquote then drop blockquote element.

    If insert-line occurs as the only child within blockquote then drop outer blockquote in NewLexis conversion.

    Source XML

    
    <blockquote>
      <p>
    	<text>
    	  <emph typestyle="it">Ordinary Resolution</emph>
    	</text>
      </p>
      <p>
    	<text>
    	  <emph typestyle="it">Approval of new issue of Securities</emph>
    	</text>
      </p>
      <p>
    	<text>To consider, and if thought fit, pass with or without amendment, the following resolution as an ordinary resolution:</text>
      </p>
      <p>
    	<blockquote>
    	  <p>
    		<text>&#x201c;That for the purposes of ASX Listing Rule 7.1 and for all other purposes, the Company approves and agrees to the issue of 35,000,000 ordinary fully paid shares in the capital of the Company to Greater Pacific Gold Limited as consideration for the variation of the Joint Venture Agreement entered into between the Company and Greater Pacific Gold Limited on the terms and conditions set out in the Explanatory Statement accompanying this Notice of Meeting.&#x201d;
    		</text>
    	  </p>
    	</blockquote>
      </p>
    </blockquote>
    
    	

    Target XML

    
    <blockquote>
      <p>
    	<text>
    	  <emph typestyle="it">Ordinary Resolution</emph>
    	</text>
      </p>
      <p>
    	<text>
    	  <emph typestyle="it">Approval of new issue of Securities</emph>
    	</text>
      </p>
      <p>
    	<text>To consider, and if thought fit, pass with or without amendment, the following resolution as an ordinary resolution:</text>
      </p>
      <p>
    	<blockquote>
    	  <p>
    		<text>&#x201c;That for the purposes of ASX Listing Rule 7.1 and for all other purposes, the Company approves and agrees to the issue of 35,000,000 ordinary fully paid shares in the capital of the Company to Greater Pacific Gold Limited as consideration for the variation of the Joint Venture Agreement entered into between the Company and Greater Pacific Gold Limited on the terms and conditions set out in the Explanatory Statement accompanying this Notice of Meeting.&#x201d;
    		</text>
    	  </p>
    	</blockquote>
      </p>
    </blockquote>
    
    	

    If source document having "2" or more blockquote elements in sibling, then convert all blockquote into only one blockquote element in NL conversion.

    Source XML

                
                <blockquote>
                <p><text>[24] Showing the jury what the appellant looked like when wearing the balaclava and overalls that were in evidence (with or without the addition of sunglasses that had not been received in evidence) could not &ldquo;rationally affect (directly or indirectly) the assessment of the probability of the existence of a fact in issue in the proceeding&rdquo;. <fnr fnrtoken="ABCE.ACE.1002.ANT15-R" fntoken="ABCE.ACE.1002.ANT15">15</fnr> The central issue at the appellant&rsquo;s trial was whether he was the robber. There was no dispute that there had been a robbery. There was no dispute that the robber had been wearing a balaclava, overalls and sunglasses.</text></p>
                </blockquote>
                <blockquote>
                <p><text>[25] No one asserted, however, that the person wearing the disguise of balaclava, overalls and sunglasses could be identified by looking at that person during the robbery or could be identified by looking at the security photographs. None of the witnesses, not even the witness who had seen the robber without the balaclava pulled down over his face, said that they could recognise the man who was thus attired. None of the witnesses, and neither trial counsel, asserted that the person depicted in the security photographs could be identified.</text></p>
                </blockquote>
                <blockquote>
                <p><text>[26] Looking at the appellant wearing the balaclava and overalls (with or without sunglasses) enabled a comparison between no more than the items he put on and what was depicted in the security photographs. But that comparison could be drawn without the appellant being asked to put them on. Dressing the appellant in the items provided no information to the jury that could rationally affect, directly or indirectly, the determination of any fact in issue because it revealed nothing about the wearer and nothing about the appellant that was not already apparent to the jury observing him in the dock.</text></p>
                </blockquote>
            

    Source XML

                
                <blockquote>
                <p><text>&#x005B;24&#x005D; Showing the jury what the appellant looked like when wearing the balaclava and overalls that were in evidence &#x0028;with or without the addition of sunglasses that had not been received in evidence&#x0029; could not &#x201C;rationally affect &#x0028;directly or indirectly&#x0029; the assessment of the probability of the existence of a fact in issue in the proceeding&#x201D;. <footnote/> The central issue at the appellant&#x2019;s trial was whether he was the robber. There was no dispute that there had been a robbery. There was no dispute that the robber had been wearing a balaclava, overalls and sunglasses.</text></p>
                <p><text>&#x005B;25&#x005D; No one asserted, however, that the person wearing the disguise of balaclava, overalls and sunglasses could be identified by looking at that person during the robbery or could be identified by looking at the security photographs. None of the witnesses, not even the witness who had seen the robber without the balaclava pulled down over his face, said that they could recognise the man who was thus attired. None of the witnesses, and neither trial counsel, asserted that the person depicted in the security photographs could be identified.</text></p>
                <p><text>&#x005B;26&#x005D; Looking at the appellant wearing the balaclava and overalls &#x0028;with or without sunglasses&#x0029; enabled a comparison between no more than the items he put on and what was depicted in the security photographs. But that comparison could be drawn without the appellant being asked to put them on. Dressing the appellant in the items provided no information to the jury that could rationally affect, directly or indirectly, the determination of any fact in issue because it revealed nothing about the wearer and nothing about the appellant that was not already apparent to the jury observing him in the dock.</text></p>
                </blockquote>
            

    Source XML where blockquote contains a figure

    
    <blockquote>
        <figure>
            <glp:note>
                <h>(MAB PROGRAMME STRUCTURE)</h>
            </glp:note>
            <inlineobject type="image" attachment="ln-server" filename="pbep-g00121.gif"/>
        </figure>
    </blockquote>
    
    	

    Target XML where blockquote contains a figure

    
    <figure>
        <note>
            <bodytext>
                <h>(MAB PROGRAMME STRUCTURE)</h>
            </bodytext>
        </note>
        <ref:inlineobject>
            <ref:locator>
                <ref:locator-key>
                    <ref:key-name name="object-key"/>
                    <ref:key-value value="X-Y-pbep-g00121"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                </ref:locator-key>
                <ref:locator-params>
                    <proc:param name="componentseq" value="1"/>
                    <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                    <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                </ref:locator-params>
            </ref:locator>
        </ref:inlineobject>
    </figure>
    
    	

    Description

     start topichead  blockquote  
     <topicref href="../../common_newest/Rosetta_blockquote-LxAdv-blockquote.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_blockquote-LxAdv-blockquote.dita  
     JL: refactored :
            1. if legfragment will end up being a child of bodytext if we strip away the paragraph and/or blockquote wrapper, we strip the 
            blockquote wrapper. This leads to an extensive list of potential input parents in the first condition.  PLEASE NOTE: this 
            condition works together with the generic Rosetta_p-LxAdv-p.xsl module.
            
            2. If blockquote has certain other children, such as figure, we remove the blockquote wrapper for those children.
            
            3. If blockquote doesn't meet conditions 1 and 2 above, and if it has adjacent sibling blockquotes that also don't meet the conditions 1 and 2 above, that 
            blockquote and its siblings are merged into one blockquote element.
            
        
     REFACTORED AGAIN!!!!!!
            ANY CONDITION OF COMPLEXITY SHOULD PREVENT MERGE.
            THESE CONDITIONS PREVENT MERGE:
            	    1. legfragment conditions - this is the case where there is no merge and the blockquote wrapper is dropped
            	    2. child bump-ups - this is the case some children become siblings of blockquote and blockquote wrappers
            	    will open and close as necessary until all children  are output properly
            	    3. blockquote is empty - nothing will be output and nothing will be merged
            	    4. blockquote will be wrapped in other elements such as bodytext.
            	    5. any other specific conditions that will make merging difficult or impossible.
            	    
            	    THESE CONDITIONS CAUSE A  MERGE to start:
            	    current blockquote does not have a prevent-merge condition
            	    first preceding sibling is not a blockquote with a merge condition
            	    
            	    THESE CONDITIONS CAUSE A MERGE TO continue on
            	     current blockquote does not have a prevent-merge condition
            	     first following sibling is a blockquote that does not have a prevent-merge condition.
            	     
            	    THESE CONDITIONS CAUSE A MERGE TO stop
            	    current blockquote does not have a prevent-merge condition
            	    first following sibling is not a blockquote with a merge condition.
            	    
            	    IF YOU ADD A NEW CONDITION TO PREVENT MERGE to this template: 
            	    make sure to add an xsl:when with the condition at the annotated place
            	    with the desired non-merged output; also add the condition as an xsl:when to 
            	    the named 'doImeetMergeConditions' template with the value 'false'.
            	    
            	    
    Namespace No namespace
    Match blockquote
    Mode #default
    References
    Template
    Variable
    Import precedence 0
    Source
    <xsl:template match="blockquote">
      <xsl:variable name="currentMergeConditions">
        <xsl:call-template name="doImeetMergeConditions"/>
      </xsl:variable>
      <xsl:variable name="precedingSibMergeConditions">
        <xsl:choose>
          <xsl:when test="not(preceding-sibling::*[1])">false</xsl:when>
          <xsl:otherwise>
            <xsl:for-each select="preceding-sibling::*[1]">
              <xsl:call-template name="doImeetMergeConditions"/>
            </xsl:for-each>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:variable name="followingingSibMergeConditions">
        <xsl:choose>
          <xsl:when test="not(following-sibling::*[1])">false</xsl:when>
          <xsl:otherwise>
            <xsl:for-each select="following-sibling::*[1]">
              <xsl:call-template name="doImeetMergeConditions"/>
            </xsl:for-each>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:choose>
        <!-- THIS IS A PREVENT-MERGE CONDITION -->
        <!-- JD: 2017-07-21: added trap for empty node to match DT output. (suppress <blockquote/> from output  -->
        <xsl:when test="not(node())"/>
        <!-- Vikas Rohilla : 2017-08-09 added parent is case:factsummary            -->
        <xsl:when test="legfragment and not(child::*[2]) and (parent::p[parent::*:bodytext or parent::pgrp or parent::li or parent::fnbody or parent::glp:note or parent::case:judgmentbody or parent::case:appendix] or parent::*:bodytext or parent::li or parent::pgrp or parent::fnbody or parent::glp:note or parent::case:judgmentbody or parent::case:appendix or parent::case:factsummary)">
          <!-- THIS IS A PREVENT-MERGE CONDITION -->
          <xsl:apply-templates/>
        </xsl:when>
        <!--<xsl:when test="ancestor::frm:divs[$streamID='UK12']">
                    <xsl:apply-templates select="node()"/>
                </xsl:when>-->
        <xsl:when test="parent::case:decisionsummary and $streamID='UK03'">
          <!-- THIS IS A PREVENT-MERGE CONDITION -->
          <bodytext>
            <blockquote>
              <xsl:apply-templates select="node()"/>
            </blockquote>
          </bodytext>
        </xsl:when>
        <xsl:when test="$streamID='AU09' and parent::case:decisionsummary and child::case:embeddedcase/child::case:content">
          <!-- THIS IS A PREVENT-MERGE CONDITION -->
          <xsl:apply-templates select="@* | node()"/>
        </xsl:when>
        <xsl:when test="figure or (insert-line and not(child::*[2]))                 or (parent::glp:note and descendant::inlineobject[@filename = 'leg1.gif' or @filename = 'leg1.png'])">
          <!-- THIS IS A PREVENT-MERGE CONDITION -->
          <!-- do not group because it introduces too much complexity. These are your normal bump-ups.
                    -->
          <xsl:for-each-group select="*" group-adjacent="if (self::figure or (self::insert-line and not(parent::blockquote/child::*[2]))                     or (parent::blockquote[parent::glp:note] and descendant-or-self::inlineobject[@filename = 'leg1.gif' or @filename = 'leg1.png'])) then                     0                     else                     1">
            <xsl:choose>
              <xsl:when test="current-grouping-key()=0">
                <xsl:apply-templates select="current-group()"/>
              </xsl:when>
              <xsl:otherwise>
                <blockquote>
                  <xsl:apply-templates select="current-group()"/>
                </blockquote>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each-group>
        </xsl:when>
        <!-- IF YOU HAVE ANY OTHER CONDITION REQUIRING SPECIAL HANDLING AND OPTING OUT OF THE MERGE, ADD IT HERE
               AND IN THE  NAMED 'doImeetMergeConditions' TEMPLATE BELOW.  ASSIGN IT THE VALUE 'false' IN THAT NAMED TEMPLATE.-->
        <!-- THE FOLLOWING CONDITION IS A CONDITION THAT ALLOWS MERGE TO START
                IT MUST EXCLUDE ALL PREVENT-MERGE CONDITIONS - this can be done by placing prevent-merge conditions first
                IT MUST SPECIFICALLY INCLUDE ALL START-MERGE CONDITIONS 
                -->
        <xsl:when test="$currentMergeConditions='true' and $precedingSibMergeConditions='false'">
          <!-- this is a simple blockquote and  can be the start of a group  as long as all the simple blockquotes are consecutive-->
          <blockquote>
            <xsl:apply-templates/>
            <xsl:if test="$followingingSibMergeConditions='true'">
              <xsl:apply-templates select="following-sibling::*[1][self::blockquote]" mode="next"/>
            </xsl:if>
          </blockquote>
        </xsl:when>
        <xsl:when test="$precedingSibMergeConditions='true' and $currentMergeConditions='true'">
          <!-- this becomes part of the merge so we don't want to hit it twice -->
        </xsl:when>
        <xsl:otherwise>
          <blockquote>
            <xsl:apply-templates/>
          </blockquote>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template blockquotenext
    Namespace No namespace
    Match blockquote
    Mode next
    References
    Import precedence 0
    Source
    <xsl:template match="blockquote" mode="next">
      <!-- we do not need to test for current merge conditions because we have already tested for it in the condition where the template is called  -->
      <xsl:variable name="followingingSibMergeConditions">
        <xsl:choose>
          <xsl:when test="not(following-sibling::*[1])">false</xsl:when>
          <xsl:otherwise>
            <xsl:for-each select="following-sibling::*[1]">
              <xsl:call-template name="doImeetMergeConditions"/>
            </xsl:for-each>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:apply-templates/>
      <xsl:if test="$followingingSibMergeConditions='true'">
        <xsl:apply-templates select="following-sibling::*[1][self::blockquote]" mode="next"/>
      </xsl:if>
    </xsl:template>
    Template doImeetMergeConditions
    Namespace No namespace
    Used by
    References
    Variable
    Import precedence 0
    Source
    <xsl:template name="doImeetMergeConditions">
      <!-- NOTE IF YOU ADD A NEW CONDITION TO THE NON-MERGE CONDITIONS ABOVE YOU NEED TO ADD IT HERE TOO! -->
      <xsl:choose>
        <xsl:when test="not(self::blockquote)">false</xsl:when>
        <xsl:when test="not(node())">false</xsl:when>
        <xsl:when test="legfragment and not(child::*[2]) and                  (parent::p[parent::*:bodytext or parent::pgrp or parent::li or parent::fnbody or parent::glp:note or parent::case:judgmentbody                  or parent::case:appendix] or parent::*:bodytext or parent::li or parent::pgrp or parent::fnbody or parent::glp:note or                  parent::case:judgmentbody or parent::case:appendix)">false</xsl:when>
        <xsl:when test="parent::case:decisionsummary and $streamID='UK03'">false</xsl:when>
        <xsl:when test="$streamID='AU09' and parent::case:decisionsummary and child::case:embeddedcase/child::case:content">false</xsl:when>
        <xsl:when test="figure or (insert-line and not(child::*[2]))                 or (parent::glp:note and descendant::inlineobject[@filename = 'leg1.gif' or @filename = 'leg1.png'])">false</xsl:when>
        <xsl:otherwise>true</xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template blockquote/link
    Documentation
    Namespace No namespace
    Match blockquote/link
    Mode #default
    Import precedence 0
    Source
    Template bodytext
    Documentation

    Description

    bodytext becomes bodytext

    • @searchtype attribute should be suppressed.

    Source XML 1

     <bodytext> <p><text>This is a judgment of some significance for daily conveyancing practice.</text></p> </bodytext> 

    Target XML 1

     <bodytext> <p><text>This is a judgment of some significance for daily conveyancing practice.</text></p> <bodytext> 

    Source XML 2

     <bodytext searchtype="COMMENTARY"> <p><text>Final recommendation 5. Interim recommendations pp 19 and 22.</text></p> </bodytext> 

    Target XML 2

     <bodytext> <p><text>Final recommendation 5. Interim recommendations pp 19 and 22.</text></p> <bodytext> 

    Description

     end topichead  blockquote  
     start topichead  bodytext  
     <topicref href="../../common_newest/Rosetta_bodytext-LxAdv-bodytext.dita"/> 
    Vikas Rohilla : Updated the template for the streamID CA02DC  
    Namespace No namespace
    Match bodytext
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="bodytext">
      <xsl:choose>
        <!-- JL: added the junk characters to get rid of bodytext elements in AU/NZ when there are nbsp and the junk character in them -->
        <xsl:when test="parent::leg:comntry and not(child::*[not(self::p[not(child::*[not(self::text[normalize-space(string-join(., '')) = ('', ' ', ' ')])])] or self::hrule)])"/>
        <!-- BRT 11/29/17  WS7053986 suppress this context for UK15cs -->
        <xsl:when test="references and name(preceding-sibling::*[1]) = 'level' and $streamID = 'UK15'"/>
        <xsl:when test="child::glp:note and parent::dig:body and $streamID = 'CA02DC'">
          <xsl:apply-templates select="node() | @*"/>
        </xsl:when>
        <xsl:when test="child::case:embeddedcase and $streamID = 'CA02DS'">
          <xsl:apply-templates select="node() | @*"/>
        </xsl:when>
        <xsl:when test="@searchtype = 'COMMENTARY' and $streamID = ('AU08') and parent::level/@leveltype = 'group'">
          <bodytext>
            <xsl:apply-templates select="@* | node()"/>
          </bodytext>
        </xsl:when>
        <xsl:when test="@searchtype = 'COMMENTARY' and $streamID = ('AU08') and parent::level">
          <bodytext>
            <!-- use case AU08 PS2017050402162840900LNIAUCOURTRULES_input_fcr10081327.xml for bodytext
    										PS2017042901112352335LNIAUCOURTRULES_input_voff10081099.xml for glp:note as preceding sibling
    										-->
            <xsl:apply-templates select="preceding-sibling::glp:note"/>
            <xsl:apply-templates select="@* | node()"/>
          </bodytext>
        </xsl:when>
        <xsl:when test="parent::entry">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:when>
        <!-- Added instruction for UK15 by Priya Kaushal -->
        <xsl:when test="$streamID = 'UK15'">
          <xsl:if test="not(./child::references[1]) or ./child::references[1]/preceding-sibling::node()">
            <seclaw:bodytext>
              <xsl:apply-templates select="@* | node()"/>
              <xsl:for-each select="following-sibling::level">
                <xsl:call-template name="bodytext-following-level"/>
              </xsl:for-each>
              <xsl:for-each select="following-sibling::bodytext/references">
                <xsl:call-template name="bodytext-references"/>
              </xsl:for-each>
            </seclaw:bodytext>
          </xsl:if>
          <!--<xsl:choose>
    					<xsl:when test="not(./references)">
    						<seclaw:bodytext>
    							<xsl:apply-templates select="@* | node()"/>
    							<xsl:for-each select="following-sibling::level">
    								<xsl:call-template name="bodytext-following-level"/>
    							</xsl:for-each>
    							<xsl:for-each select="following-sibling::bodytext/references">
    								
    								<xsl:call-template name="bodytext-references"/>
    							</xsl:for-each>
    						</seclaw:bodytext>
    					</xsl:when>
    					<xsl:otherwise>
    						
    						
    							<!-\-<xsl:for-each select="following-sibling::level">
    								<xsl:call-template name="bodytext-following-level"/>
    							</xsl:for-each>-\->
    							
    						
    					</xsl:otherwise>
    				</xsl:choose>-->
        </xsl:when>
        <xsl:when test="$streamID ='MY02'">
          <xsl:apply-templates select="node()"/>
        </xsl:when>
        <xsl:when test="$streamID='UK09'">
          <xsl:choose>
            <xsl:when test="footnotegrp/footnote">
              <bodytext>
                <xsl:apply-templates select="preceding-sibling::glp:note[parent::level]"/>
                <xsl:apply-templates select="@* | node()"/>
              </bodytext>
            </xsl:when>
            <xsl:otherwise>
              <bodytext>
                <xsl:apply-templates select="preceding-sibling::glp:note[parent::level]"/>
                <xsl:apply-templates select="@* | node() except(footnotegrp)"/>
              </bodytext>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:otherwise>
          <bodytext>
            <xsl:apply-templates select="preceding-sibling::glp:note[parent::level]"/>
            <xsl:apply-templates select="@* | node()"/>
          </bodytext>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template bodytext[ancestor::leg:comntry and (not(parent::level/@leveltype) and not(parent::level/parent::leg:comntry))][$streamID = ('UK06', 'UK07')]
    Namespace No namespace
    Match bodytext[ancestor::leg:comntry and (not(parent::level/@leveltype) and not(parent::level/parent::leg:comntry))][$streamID = ('UK06', 'UK07')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="bodytext[ancestor::leg:comntry and (not(parent::level/@leveltype) and not(parent::level/parent::leg:comntry))][$streamID = ('UK06', 'UK07')]">
      <annot:bodytext>
        <xsl:apply-templates select="@* | node()"/>
      </annot:bodytext>
    </xsl:template>
    Template bodytext-following-level
    Documentation

    Description

     Added template for UK15 by Priya kaushal 
    Namespace No namespace
    Used by
    Template
    Import precedence 0
    Source
    <xsl:template name="bodytext-following-level">
      <xsl:choose>
        <xsl:when test="child::heading/title/refpt">
          <seclaw:level>
            <xsl:attribute name="leveltype">
              <xsl:value-of select="@leveltype"/>
            </xsl:attribute>
            <!--<xsl:apply-templates select="child::heading/title/refpt"/>-->
            <xsl:apply-templates select="@* | node() except (level[preceding-sibling::bodytext])"/>
          </seclaw:level>
        </xsl:when>
        <xsl:when test="child::heading/title and (./child::heading/following-sibling::node())">
          <seclaw:level>
            <xsl:attribute name="leveltype">
              <xsl:value-of select="@leveltype"/>
            </xsl:attribute>
            <!--<xsl:apply-templates select="child::heading/title"/>-->
            <xsl:apply-templates select="@* | node() except (level[preceding-sibling::bodytext])"/>
          </seclaw:level>
        </xsl:when>
        <xsl:when test="child::heading/title and not(./child::heading/following-sibling::node())">
          <seclaw:level>
            <xsl:attribute name="leveltype">
              <xsl:value-of select="@leveltype"/>
            </xsl:attribute>
            <!--<xsl:apply-templates select="child::heading/title"/>-->
            <xsl:apply-templates select="@* | node() except (level[preceding-sibling::bodytext])"/>
            <seclaw:bodytext/>
          </seclaw:level>
        </xsl:when>
      </xsl:choose>
    </xsl:template>
    Template bodytext-references
    Documentation

    Description

     Added template for UK15 by Priya kaushal 
    Namespace No namespace
    Used by
    Template
    Import precedence 0
    Source
    <xsl:template name="bodytext-references">
      <ref:relatedrefs>
        <xsl:apply-templates select="@* | node()"/>
      </ref:relatedrefs>
    </xsl:template>
    Template level[preceding-sibling::bodytext[not(./child::references[1]) or ./child::references[1]/preceding-sibling::node()]][$streamID = 'UK15']
    Documentation

    Description

    ***********
    		
    		BRT 11/26/17 the following template causes an ambiguity error with a more generic template - template match="level[1][parent::level]" 
    	WS7051206. This template prevents duplicate seclaw:bodytext entries 
    Namespace No namespace
    Match level[preceding-sibling::bodytext[not(./child::references[1]) or ./child::references[1]/preceding-sibling::node()]][$streamID = 'UK15']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="level[preceding-sibling::bodytext[not(./child::references[1]) or ./child::references[1]/preceding-sibling::node()]][$streamID = 'UK15']"/>
    Template bodytext/@searchtype
    Namespace No namespace
    Match bodytext/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="bodytext/@searchtype"/>
    Template char-line
    Documentation

    Description

    char-line becomes proc:formchars and includes the attributes @formchar and @formcharuse. Attributes @formchar and @formcharuse are required attributes in proc:formchars and the values for these attributes are tokenized in the NewLexis Schema.

    Attribute @formchar allows the tokenized values listed below:

    • proc:formchars[@formchar="dot"]
    • proc:formchars[@formchar="rule"]
    • proc:formchars[@formchar="dbl-rule"]
    • proc:formchars[@formchar="hypen"]
    • proc:formchars[@formchar="invisible"]
    Below are the values for proc:formchars[@formchar] found in the source documents and the corresponding mapping in NewLexis.
    • char-line[@character="."] becomes proc:formchars[@formchar="dot"]
    • char-line[@character="_"] becomes proc:formchars[@formchar="rule"]
    • char-line[@character="-"] becomes proc:formchars[@formchar="hypen"]
    • char-line[@character=" "] becomes proc:formchars[@formchar="invisible"]
    • char-line[@character="&nbsp;"] becomes proc:formchars[@formchar="invisible"]

    Attribute @formcharuse values are listed below:

    • proc:formchars[@formcharuse="date"]
    • proc:formchars[@formcharuse="day"]
    • proc:formchars[@formcharuse="month"]
    • proc:formchars[@formcharuse="year"]
    • proc:formchars[@formcharuse="num"]
    • proc:formchars[@formcharuse="money"]
    • proc:formchars[@formcharuse="address"]
    • proc:formchars[@formcharuse="name"]
    • proc:formchars[@formcharuse="longname"]
    • proc:formchars[@formcharuse="leaderfill"] @formcharuse="leaderfill" means fill the available space with the formchar. Basically, push the text on each side out to the margins if possible.
    • proc:formchars[@formcharuse="other"]
    The following are the widths (in points) used for this element in print for each possible value of @formcharuse. To determine the number of characters, divide the point value by 6.
    • proc:formchars[@formcharuse="date"] 66 ->11
    • proc:formchars[@formcharuse="day"] 36 ->6
    • proc:formchars[@formcharuse="month"] 48 -> 8
    • proc:formchars[@formcharuse="year"] 36 -> 6
    • proc:formchars[@formcharuse="num"] 36 -> 6
    • proc:formchars[@formcharuse="money"] 42 -> 7
    • proc:formchars[@formcharuse="address"] 72 -> 12
    • proc:formchars[@formcharuse="name"] 66 -> 11
    • proc:formchars[@formcharuse="longname"] 132 -> 22
    • proc:formchars[@formcharuse="other"] 66 -> 11
    Below are the values for proc:formchars[@formcharuse] found in the source documents and the corresponding mapping in NewLexis.
    • char-line[@num-char="2"] becomes proc:formchars[@formcharuse="day"]
    • char-line[@num-char="4"] becomes proc:formchars[@formcharuse="day"]
    • char-line[@num-char="8"] becomes proc:formchars[@formcharuse="month"]
    • char-line[@num-char="12"] becomes proc:formchars[@formcharuse="address"]
    • char-line[@num-char="16"] becomes proc:formchars[@formcharuse="longname"]

    Note: A CR is required to add attribute @align within proc:formchars.

    Source XML

    
    <p>
        <blockquote>
            <char-line character="_" num-char="15" align="center"/>
        </blockquote>
    </p>
    
    	

    Target XML

    
    <p>
        <blockquote>
            <proc:formchars formchar="rule" formcharuse="longname" align="center"/>
        </blockquote>
    </p>
    
    		

    Description

    <topicref href="../../common_newest/Rosetta_Commentary_bodytext-LxAdv-bodytext_note.dita"/>
     end topichead  bodytext  
     rosetta element: char-line 
     <topicref href="../../common_newest/Rosetta_char-line-LxAdv-proc.formchars.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_char-line-LxAdv-proc.formchars.dita  
     Vikas Rohilla : Template to match the char-line and create the proc:formchars	
    Namespace No namespace
    Match char-line
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="char-line">
      <xsl:choose>
        <xsl:when test="$streamID='AU01' and parent::case:judgmentbody">
          <p>
            <text>
              <proc:formchars>
                <xsl:attribute name="formchar">
                  <xsl:choose>
                    <xsl:when test="@character='_'">
                      <xsl:text>rule</xsl:text>
                    </xsl:when>
                    <xsl:when test="@character='.'">
                      <xsl:text>dot</xsl:text>
                    </xsl:when>
                    <xsl:when test="@character='-'">
                      <xsl:text>hypen</xsl:text>
                    </xsl:when>
                    <xsl:when test="@character=' '">
                      <xsl:text>invisible</xsl:text>
                    </xsl:when>
                    <xsl:when test="@character='&nbsp;'">
                      <xsl:text>invisible</xsl:text>
                    </xsl:when>
                  </xsl:choose>
                </xsl:attribute>
                <xsl:attribute name="formcharuse">
                  <xsl:choose>
                    <xsl:when test="@num-char='2'">
                      <xsl:text>day</xsl:text>
                    </xsl:when>
                    <xsl:when test="@num-char='4'">
                      <xsl:text>day</xsl:text>
                    </xsl:when>
                    <xsl:when test="@num-char='8'">
                      <xsl:text>month</xsl:text>
                    </xsl:when>
                    <xsl:when test="@num-char='12'">
                      <xsl:text>address</xsl:text>
                    </xsl:when>
                    <xsl:when test="@num-char='16'">
                      <xsl:text>longname</xsl:text>
                    </xsl:when>
                    <!-- Awantika: 2017-10-31- Added @num-char='32' to formcharuse="other" coming in AU01 -->
                    <xsl:when test="@num-char='32'">
                      <xsl:text>other</xsl:text>
                    </xsl:when>
                  </xsl:choose>
                </xsl:attribute>
                <xsl:if test="@align[not($streamID='AU01')]">
                  <xsl:copy-of select="@align"/>
                </xsl:if>
              </proc:formchars>
            </text>
          </p>
        </xsl:when>
        <xsl:otherwise>
          <proc:formchars>
            <xsl:attribute name="formchar">
              <xsl:choose>
                <xsl:when test="@character='_'">
                  <xsl:text>rule</xsl:text>
                </xsl:when>
                <xsl:when test="@character='.'">
                  <xsl:text>dot</xsl:text>
                </xsl:when>
                <xsl:when test="@character='-'">
                  <xsl:text>hypen</xsl:text>
                </xsl:when>
                <xsl:when test="@character=' '">
                  <xsl:text>invisible</xsl:text>
                </xsl:when>
                <xsl:when test="@character='&nbsp;'">
                  <xsl:text>invisible</xsl:text>
                </xsl:when>
              </xsl:choose>
            </xsl:attribute>
            <xsl:attribute name="formcharuse">
              <xsl:choose>
                <xsl:when test="@num-char='2'">
                  <xsl:text>day</xsl:text>
                </xsl:when>
                <xsl:when test="@num-char='4'">
                  <xsl:text>day</xsl:text>
                </xsl:when>
                <xsl:when test="@num-char='8'">
                  <xsl:text>month</xsl:text>
                </xsl:when>
                <xsl:when test="@num-char='12'">
                  <xsl:text>address</xsl:text>
                </xsl:when>
                <xsl:when test="@num-char='16'">
                  <xsl:text>longname</xsl:text>
                </xsl:when>
              </xsl:choose>
            </xsl:attribute>
            <xsl:if test="@align">
              <xsl:copy-of select="@align"/>
            </xsl:if>
          </proc:formchars>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template ci:cite
    Documentation

    Description

    Instructions

    In the Fab Pipeline, JCite/CFE shall conduct a lookup based on the lnci:content or the @normcite (if populated) and populate the markup with the additional keywords needed for cite traversal.

    The only markup needed for JCite/CFE is lnci:cite/lnci:content and optionally lnci:cite/@normcite. In order to resolve the correct “pile” target for cite link traversal, either a semantic child content type element as described below or the lnci:cite/@type attribute (but not both) must also be present in the output markup.

    ci:cite becomes lnci:cite, with all attribute names and values copied as they occur in the source. Convert all descendant elements of ci:cite by copying the elements and their attribute names and values from the ci: namespace as is into the lnci: namespace. That is, every descendant of ci:cite that has the form ci:{element-name} is converted to lnci:{element-name}. As an example of converting the descendants of ci:cite into the lnci: namespace, here is a partial list of the child elements from Rosetta and what they should be converted to:

    • ci:casename becomes lnci:casename
    • ci:constref becomes lnci:constref
    • ci:courtruleref becomes lnci:courtruleref
    • ci:decisionref becomes lnci:decisionref
    • ci:effdate becomes lnci:effdate
    • ci:party1 becomes lnci:party1
    • ci:party2 becomes lnci:party2
    • ci:procphrase becomes lnci:procphrase
    • ci:reglref becomes lnci:reglref
    • ci:statinfo becomes lnci:statinfo
    • ci:text becomes lnci:text

    There are two important exceptions to the converstion instructions given in the preceding paragraph:

    • Do not convert any Rosetta-only markup that, if kept, would make the output invalid.
    • Drop the start and end tags (the mark-up) for citefragment and ci:span but keep the content of these elements as part of what is converted to the content of lnci:content.
    • Drop all instances of ci:{element-name}/@spanref.

    The following are mappings for children of ci:cite:

    • ci:case becomes lnci:case
    • ci:stat becomes lnci:stat
    • ci:juryinstr becomes lnci:juryinstr
    • ci:reg becomes lnci:reg
    • ci:courtrule becomes lnci:courtrule
    • ci:sesslaw becomes lnci:sesslaw
    • ci:patent becomes lnci:patent
    • ci:tmark becomes lnci:tmark
    • ci:copyright becomes lnci:copyright
    • ci:lawrev becomes lnci:lawrev
    • ci:periodical becomes lnci:periodical
    • ci:pinpoint becomes lnci:pinpoint
    • ci:book becomes lnci:book
    • ci:oag becomes lnci:oag
    • ci:agencydecision becomes lnci:agencydecision
    • ci:constitution becomes lnci:constitution
    • ci:annot becomes lnci:annot
    • ci:execdoc becomes lnci:execdoc
    • ci:admininterp becomes lnci:admininterp
    • ci:misc becomes lnci:misc
    • ci:form becomes lnci:form
    Given one of the above mappings, the source ci:cite/@searchtype should be dropped and the target lnci:cite/@type should be omitted.

    In the absence of one of the possible children of ci:cite listed above, lnci:cite/@type should be populated as follows:

    • ci:cite/@searchtype="LEG-REF" becomes lnci:cite/@type="legislation"
    • ci:cite/@searchtype="CASE-REF" becomes lnci:cite/@type="case"
    • ci:cite/@searchtype="BOOK-REF" becomes lnci:cite/@type="book"
    • ci:cite/@searchtype="BODY-CASE-REF" becomes lnci:cite/@type="case"
    • ci:cite/@searchtype="SUMM-CASE-REF" becomes lnci:cite/@type="case"
    This will ensure that the correct “context clue” (Product Content Type or PCT) is populated in the Fab Pipeline so that the resulting citation hyperlink targets the correct pile.

    Handling for AU Journals/Newsitem:

    • ci:cite with attribute @type="cite4thisdoc" becomes lnci:cite with attribute @type="cite4thisdoc"

    Handling for NZ Regulation and NZ Act from services:

    • If ci:cite@type comes with attribute value " legref " in source document then conversion needs to suppressed attribute value in target and convert ci:cite according to general rule.

    Source XML: ci:cite/searchtype="CASE-REF"

     <ci:cite searchtype="CASE-REF"> <ci:case>
    					<ci:caseinfo> <ci:decisiondate year="2001"/> </ci:caseinfo>
    					<ci:caseref ID="cr000366" spanref="cr000366-001" status="unval">
    					<ci:reporter value="NSWCCR"/> <ci:volume num="22"/> <ci:page
    					num="238"/> </ci:caseref> </ci:case> <ci:content>
    					<citefragment searchtype="CASE-NAME-REF"> <emph typestyle="it">Betts
    					v Prisk Contractors Pty Ltd</emph> </citefragment> <citefragment
    					searchtype="CASE-CITE-REF"> <ci:span spanid="cr000366-001"
    					status="unval">(2001) 22 NSWCCR 238</ci:span>; [2001] NSWCC 146
    					</citefragment> </ci:content> </ci:cite> 

    Target XML

     <lnci:cite> <lnci:case> <lnci:caseinfo>
    					<lnci:decisiondate year="2001"/> </lnci:caseinfo> <lnci:caseref
    					ID="cr000366" status="unval"> <lnci:reporter value="NSWCCR"/>
    					<lnci:volume num="22"/> <lnci:page num="238"/> </lnci:caseref>
    					</lnci:case> <lnci:content> <emph typestyle="it">Betts v Prisk
    					Contractors Pty Ltd</emph> (2001) 22 NSWCCR 238; [2001] NSWCC 146
    					</lnci:content> </lnci:cite> 

    SOURCE XML: ci:cite/searchtype="BOOK-REF"

     <ci:cite searchtype="BOOK-REF"> <ci:lawrev> <ci:lawrevref
    					ID="cr003268" spanref="cr003268-001"> <ci:lawrevlocator>
    					<ci:publicationname normpubcode="BCB"/> <ci:volume num="3"/>
    					<ci:issue> <ci:date year="1985"/> </ci:issue> <ci:page
    					num="86"/> </ci:lawrevlocator> </ci:lawrevref> </ci:lawrev>
    					<ci:content> <citefragment searchtype="BOOK-CITE-REF"> <ci:span
    					spanid="cr003268-001">(1985) 3 BCB 86</ci:span> </citefragment>
    					</ci:content> </ci:cite> 

    Target XML

     <lnci:cite> <lnci:lawrev> <lnci:lawrevref
    					ID="cr003268"> <lnci:lawrevlocator> <lnci:publicationname
    					normpubcode="BCB"/> <lnci:volume num="3"/> <lnci:issue>
    					<lnci:date year="1985"/> </lnci:issue> <lnci:page num="86"/>
    					</lnci:lawrevlocator> </lnci:lawrevref> </lnci:lawrev>
    					<lnci:content>(1985) 3 BCB 86</lnci:content> </lnci:cite>
    				

    SOURCE XML: ci:cite/searchtype="SUMM-CASE-REF"

     <ci:cite searchtype="SUMM-CASE-REF"> <ci:case>
    					<ci:caseref ID="cref00000048" spanref="cspan00000048"> <ci:reporter
    					value="FCR"/> <ci:volume num="1"/> <ci:edition><ci:date
    					year="1985"/></ci:edition> <ci:page num="856"/>
    					</ci:caseref> </ci:case> <ci:content><ci:span
    					spanid="cspan00000048">[1985] 1 F.C. 856</ci:span></ci:content>
    					</ci:cite> 

    Target XML

     <lnci:cite> <lnci:case> <lnci:caseref
    					ID="cref00000048"> <lnci:reporter value="FCR"/> <lnci:volume
    					num="1"/> <lnci:edition><lnci:date
    					year="1985"/></lnci:edition> <lnci:page num="856"/>
    					</lnci:caseref> </lnci:case> <lnci:content>[1985] 1 F.C.
    					856</lnci:content> </lnci:cite> 

    SOURCE XML: ci:cite/searchtype="BODY-CASE-REF"

     <ci:cite searchtype="BODY-CASE-REF"> <ci:case>
    					<ci:caseref ID="cref00000047" spanref="cspan00000047"> <ci:reporter
    					value="OEAB"/> <ci:edition><ci:date
    					year="1993"/></ci:edition> <ci:refnum num="55"/>
    					</ci:caseref> </ci:case> <ci:content><ci:span
    					spanid="cspan00000047">[1993] O.E.A.B. No. 55</ci:span>
    					</ci:content> </ci:cite> 

    Target XML

     <lnci:cite> <lnci:case> <lnci:caseref
    					ID="cref00000047"> <lnci:reporter value="OEAB"/>
    					<lnci:edition><lnci:date year="1993"/></lnci:edition>
    					<lnci:refnum num="55"/> </lnci:caseref> </lnci:case>
    					<lnci:content>[1993] O.E.A.B. No. 55</lnci:content>
    					</lnci:cite> 

    Source XML: ci:pinpoint

     <ci:cite ID="I5DDT1GS2SF8P90080000400" normprotocol="lexsee"
    					status="valid"> <ci:agencydecision> <ci:decisionref
    					ID="I5DDT1GS2SF8P90070000400"> <ci:reporter normpubcode="4007"
    					value=""/> <ci:ldi jumppage="1" kw="8197_1999_805*.1" page="805"
    					pagesuffix="*" reporter="8197" volume="1999"/> <ci:volume num="1999"/>
    					<ci:page num="805"/> <ci:pinpoint lastnum="2" num="1"/>
    					</ci:decisionref> </ci:agencydecision> <ci:content>1999 SEC
    					No-Act. LEXIS 805, 1-2</ci:content> </ci:cite> 

    Target XML: lnci:pinpoint

     <lnci:cite ID="I5DDT1GS2SF8P90080000400" normprotocol="lexsee"
    					status="valid"> <lnci:agencydecision> <lnci:decisionref
    					ID="I5DDT1GS2SF8P90070000400"> <lnci:reporter normpubcode="4007"
    					value=""/> <lnci:ldi jumppage="1" kw="8197_1999_805*.1" page="805"
    					pagesuffix="*" reporter="8197" volume="1999"/> <lnci:volume
    					num="1999"/> <lnci:page num="805"/> <lnci:pinpoint lastnum="2"
    					num="1"/> </lnci:decisionref> </lnci:agencydecision>
    					<lnci:content>1999 SEC No-Act. LEXIS 805, 1-2</lnci:content>
    					</lnci:cite> 

    Exception: When link is used as intra-document linking within ci:content .

    If the ci:content contains a link child, the link wrapper markup (not its content) shall be removed (omit tag and retain content) and the link/@refpt value shall be moved to lnci:cite/@citeref.

    SOURCE XML: ci:content/link

     <p> <pnum count="5">[5]</pnum> <refpt
    					id="20023NZLR_113_p5" type="ext" /> <text>A number of issues were
    					raised on Bs behalf but may be summarised as follows:</text> ...
    					</p> … <ci:cite searchtype="CASE-REF"> <ci:case>
    					<ci:caseref ID="x20023NZLR_113-171" spanref="x20023NZLR_113-171-1">
    					<ci:reporter value="nzar" country="nz" /> <ci:edition> <ci:date
    					year="2001" /> </ci:edition> <ci:page num="598" />
    					</ci:caseref> </ci:case> <ci:content> <citefragment
    					searchtype="CASE-NAME-REF"> <emph typestyle="it">Auckland District Law
    					Society v Ford</emph> </citefragment> <citefragment
    					searchtype="CASE-CITE-REF"> <ci:span
    					spanid="x20023NZLR_113-171-1">[2001] NZAR 598</ci:span>
    					</citefragment> at para [ <link
    					refpt="20023NZLR_113_p5">5</link> ] </ci:content>
    					</ci:cite> 

    Target XML

     <p> <ref:anchor id="nz_20023NZLR_113_p5" anchortype="global"
    					/> <desig value="5" inline="true">[5]</desig> <text>A
    					number of issues were raised on Bs behalf but may be summarised as
    					follows:</text> ... </p> … <lnci:cite
    					citeref="20023NZLR_113_p5"> <lnci:case> <lnci:caseref
    					ID="x20023NZLR_113-171"> <lnci:reporter value="nzar" country="nz" />
    					<lnci:edition> <lnci:date year="2001" /> </lnci:edition>
    					<lnci:page num="598" /> </lnci:caseref> </lnci:case>
    					<lnci:content> <emph typestyle="it">Auckland District Law Society v
    					Ford</emph> [2001] NZAR 598 at para [ 5 ] </lnci:content>
    					</lnci:cite> 

    Source XML: ci:cite/@type="cite4thisdoc" (AU Journals/Newsitem)

     <jrnl:journalcite> <ci:cite type="cite4thisdoc">
    					<ci:lawrev> <ci:lawrevref> <ci:lawrevlocator>
    					<ci:publicationname normpubcode="Aust Jnl of Corp Law"/> <ci:volume
    					num="15"/> <ci:page num="185"/> </ci:lawrevlocator>
    					</ci:lawrevref> </ci:lawrev> <ci:content>(2003) 15 Aust Jnl of
    					Corp Law 185</ci:content> </ci:cite> </jrnl:journalcite>
    				

    Target XML: lnci:cite/@type="cite4thisdoc" (AU Journals/Newsitem)

     <ref:cite4thisresource> <lnci:cite type="cite4thisdoc">
    					<lnci:lawrev> <lnci:lawrevref> <lnci:lawrevlocator>
    					<lnci:publicationname normpubcode="Aust Jnl of Corp Law"/> <lnci:volume
    					num="15"/> <lnci:page num="185"/> </lnci:lawrevlocator>
    					</lnci:lawrevref> </lnci:lawrev> <lnci:content>(2003) 15 Aust
    					Jnl of Corp Law 185</lnci:content> </lnci:cite>
    					</ref:cite4thisresource> 

    Source XML: ci:cite/@type="legref" (NZ Regulation)

     <glp:note> <p> <text> <ci:cite searchtype="LEG-REF"
    					type="legref"> <ci:content>Compare: SR 1958/38 r 15Q</ci:content>
    					</ci:cite> </text> </p> </glp:note> 

    Target XML

     <note> <bodytext> <p> <text> <lnci:cite>
    					<lnci:content>Compare: SR 1958/38 r 15Q</lnci:content>
    					</lnci:cite> </text> </p> </bodytext> </note>
    				

    Description

     rosetta element: ci.cite 
     <topicref href="../../common_newest/Rosetta_ci.cite-LxAdv-lnci.cite.dita"/> 
    Namespace No namespace
    Match ci:cite
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="ci:cite">
      <xsl:choose>
        <xsl:when test="parent::leg:bodytext">
          <p>
            <text>
              <lnci:cite>
                <xsl:if test="ci:content/link">
                  <xsl:attribute name="citeref" select="ci:content/link/@refpt"/>
                </xsl:if>
                <!-- MDS 2017-05-01 - Added parameter 'childElementName' to match other call.  
    				General ci:* module states to drop value of ci:cite/@searchtype if certain strings are found in first child element local-name.  
    				Previously this first child element local-name value was not being passed.  The value is not invalid but it is a diff from the DT documents. -->
                <xsl:apply-templates select="@*">
                  <xsl:with-param name="childElementName" select="local-name(child::*[1])"/>
                </xsl:apply-templates>
                <xsl:apply-templates select="node()"/>
              </lnci:cite>
            </text>
          </p>
        </xsl:when>
        <xsl:otherwise>
          <lnci:cite>
            <!-- JD: 2017-08-31: added for VSTS Issue 342175.
    				  If there is no @type, and no child element aside from <ci:content>, and the parent is case:parallelcite,
    				  then set @type='case'
    				  -->
            <xsl:if test="not(@type) and not(*[not(name()='ci:content')])         and parent::case:parallelcite and $streamID='UK05'">
              <xsl:attribute name="type" select="'case'"/>
            </xsl:if>
            <!-- MDS - 2017-08-10 - added to address instructions in CI for AU13 -->
            <!-- Awantika: Added AU01 for normcite -->
            <xsl:if test="$streamID=('AU13','AU01','HK09','UK11DN')">
              <xsl:if test="ci:case/ci:caseref[ci:reporter/@value and ci:volume/@num and         ci:edition/ci:date/@year and ci:pinpoint[@targettype='page']/@num] and        not(ci:case/ci:caseref/ci:page/@num)">
                <!-- Done simply to set the context node -->
                <xsl:for-each select="ci:case[1]/ci:caseref">
                  <xsl:attribute name="normcite">
                    <xsl:text>(</xsl:text>
                    <xsl:value-of select="ci:edition/ci:date/@year"/>
                    <xsl:text>) </xsl:text>
                    <xsl:value-of select="ci:volume/@num"/>
                    <xsl:text> </xsl:text>
                    <xsl:value-of select="ci:reporter/@value"/>
                    <xsl:text> </xsl:text>
                    <xsl:value-of select="ci:pinpoint[@targettype='page']/@num"/>
                  </xsl:attribute>
                </xsl:for-each>
              </xsl:if>
            </xsl:if>
            <!-- Ankita Singh 12 June 2017: Introducted value of lnci:cite/@type to "cite4thisdoc under jrnl:journalcite as per latest CI of UK09 -->
            <xsl:if test="$streamID = ('UK09', 'NZ08','AU14') and parent::jrnl:journalcite">
              <xsl:attribute name="type">cite4thisdoc</xsl:attribute>
            </xsl:if>
            <xsl:if test="ci:content/link">
              <xsl:attribute name="citeref" select="ci:content/link/@refpt"/>
            </xsl:if>
            <xsl:if test="ci:content/remotelink and $streamID = ('NZ14', 'NZ02','AU11','NZ08','AU14')">
              <xsl:attribute name="citeref" select="ci:content/remotelink[1]/@refpt"/>
              <!-- CSN 8/4/17 added [1] in case there are multiple remotelinks -->
            </xsl:if>
            <!-- 20170721:  MCJ:  We originally grouped NZ15 into the code for NZ14 and NZ02 but found there are differences in how DT was
    						                  handling colons and the leading underscore... so we kept NZ15 apart.  It is possibly (likely?) that something
    						                  is going to need to change.  The NZ15 code attempts to follow the instructions about using a leading underscore
    						                  and translating colons to underscores... however, it is not clear whether the target documents have had their
    						                  "cite def" processed similarly.
    					                      Also, note the added predicate that ensures that there is a remotelink that has @refpt.  It is not clear
    					                      what should happen if cite:content/remotelink[not(@refpt)] exists... hoping data is good.
    					-->
            <xsl:if test="ci:content/remotelink[@refpt] and $streamID = ('NZ15')">
              <!-- First replace any colons with underscores. -->
              <xsl:variable name="translatedCiteRefValue" select="translate(ci:content/remotelink[@refpt][1]/@refpt, ':', '_')"/>
              <!-- Now, check if the value starts with a digit... if so, prepend an underscore.  There may be other offending first characters that need to be checked but digits should cover most. -->
              <xsl:variable name="processedCiteRefValue" select="if (matches($translatedCiteRefValue, '^\d')) then concat('_', $translatedCiteRefValue) else $translatedCiteRefValue"/>
              <xsl:attribute name="citeref" select="$processedCiteRefValue"/>
            </xsl:if>
            <!-- MDS 2017-05-01 - Added parameter 'childElementName' to match other call.  
    				General ci:* module states to drop value of ci:cite/@searchtype if certain strings are found in first child element local-name.  
    				Previously this first child element local-name value was not being passed.  The value is not invalid but it is a diff from the DT documents. -->
            <xsl:apply-templates select="@*">
              <xsl:with-param name="childElementName" select="local-name(child::*[1])"/>
            </xsl:apply-templates>
            <xsl:apply-templates select="node()"/>
          </lnci:cite>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template ci:*[not(local-name() = ('cite', 'fragment', 'span', 'volume', 'page'))] | ci:volume[normalize-space(@num) != ''] | ci:page[normalize-space(@num) != '']
    Namespace No namespace
    Match ci:*[not(local-name() = ('cite', 'fragment', 'span', 'volume', 'page'))] | ci:volume[normalize-space(@num) != ''] | ci:page[normalize-space(@num) != '']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="ci:*[not(local-name() = ('cite', 'fragment', 'span', 'volume', 'page'))] | ci:volume[normalize-space(@num) != ''] | ci:page[normalize-space(@num) != '']">
      <xsl:element name="{concat('lnci:', local-name())}">
        <xsl:apply-templates select="@*">
          <xsl:with-param name="childElementName" select="node()[1]/local-name()"/>
        </xsl:apply-templates>
        <!-- Sudhanshu Srivastava 7 June 2017 : Added condition for CA03 stream Only. condition for generating lnci:popname and lnci:hiertext.-->
        <xsl:if test="$streamID = 'CA03' and local-name() = 'statinfo'">
          <xsl:variable name="beforestring" select="substring-before(ancestor::source_cttr:body/leg:info/leg:officialname, '/')"/>
          <xsl:variable name="afterstring" select="substring-after(ancestor::source_cttr:body/leg:info/leg:officialname, '/')"/>
          <xsl:variable name="fullstring" select="ancestor::source_cttr:body/leg:info/leg:officialname"/>
          <xsl:variable name="cicitecount" select="count(ancestor::source_cttr:body/leg:info/leg:officialnum/ci:cite)"/>
          <xsl:variable name="legjuris" select="ancestor::source_cttr:body/leg:info/leg:juris[1]"/>
          <xsl:variable name="legofnumchild" select="ancestor::source_cttr:body/leg:info/leg:officialnum"/>
          <xsl:if test="ancestor::leg:officialnum/parent::leg:info/parent::source_cttr:body">
            <xsl:choose>
              <xsl:when test="$cicitecount = 1">
                <xsl:choose>
                  <xsl:when test="not(contains($fullstring, '/'))">
                    <xsl:if test="not(ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite])">
                      <lnci:popname value="{$fullstring}"/>
                    </xsl:if>
                  </xsl:when>
                  <xsl:otherwise>
                    <lnci:popname value="{$beforestring}"/>
                  </xsl:otherwise>
                </xsl:choose>
                <lnci:jurisinfo>
                  <lnci:can>
                    <xsl:attribute name="district">
                      <xsl:choose>
                        <xsl:when test="$legjuris = 'PQ'">QC</xsl:when>
                        <xsl:when test="$legjuris = ('CD', 'Canada', 'UK')">CA</xsl:when>
                        <xsl:when test="$legjuris = ('NF')">NL</xsl:when>
                        <xsl:when test="$legjuris = ('NU')"/>
                        <xsl:otherwise>
                          <xsl:value-of select="$legjuris"/>
                        </xsl:otherwise>
                      </xsl:choose>
                    </xsl:attribute>
                  </lnci:can>
                </lnci:jurisinfo>
              </xsl:when>
              <xsl:when test="$cicitecount = 2">
                <xsl:choose>
                  <xsl:when test="not(contains($fullstring, '/'))">
                    <xsl:if test="not(ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite])">
                      <lnci:popname value="{$fullstring}"/>
                    </xsl:if>
                  </xsl:when>
                  <xsl:otherwise>
                    <lnci:popname value="{if(not(ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite])) then $beforestring else $afterstring}"/>
                  </xsl:otherwise>
                </xsl:choose>
                <lnci:jurisinfo>
                  <lnci:can>
                    <xsl:attribute name="district">
                      <xsl:choose>
                        <xsl:when test="$legjuris = 'PQ'">QC</xsl:when>
                        <xsl:when test="$legjuris = ('CD', 'Canada', 'UK')">CA</xsl:when>
                        <xsl:when test="$legjuris = ('NF')">NL</xsl:when>
                        <xsl:when test="$legjuris = ('NU')"/>
                        <xsl:otherwise>
                          <xsl:value-of select="$legjuris"/>
                        </xsl:otherwise>
                      </xsl:choose>
                    </xsl:attribute>
                  </lnci:can>
                </lnci:jurisinfo>
              </xsl:when>
              <xsl:when test="$cicitecount = 4">
                <xsl:choose>
                  <xsl:when test="not(contains($fullstring, '/'))">
                    <xsl:if test="not(ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite])">
                      <lnci:popname value="{$fullstring}"/>
                    </xsl:if>
                    <xsl:if test="ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite] and count(ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite]) = 1">
                      <lnci:popname value="{$fullstring}"/>
                    </xsl:if>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:if test="not(ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite])">
                      <lnci:popname value="{$beforestring}"/>
                    </xsl:if>
                    <xsl:if test="ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite] and count(ancestor::ci:cite/preceding-sibling::ci:cite) = 1">
                      <lnci:popname value="{$beforestring}"/>
                    </xsl:if>
                    <xsl:if test="count(ancestor::ci:cite/preceding-sibling::ci:cite) = 2">
                      <lnci:popname value="{$afterstring}"/>
                    </xsl:if>
                    <xsl:if test="count(ancestor::ci:cite/preceding-sibling::ci:cite) = 3">
                      <lnci:popname value="{$afterstring}"/>
                    </xsl:if>
                  </xsl:otherwise>
                </xsl:choose>
                <lnci:jurisinfo>
                  <lnci:can>
                    <xsl:attribute name="district">
                      <xsl:choose>
                        <xsl:when test="$legjuris = 'PQ'">QC</xsl:when>
                        <xsl:when test="$legjuris = ('CD', 'Canada', 'UK')">CA</xsl:when>
                        <xsl:when test="$legjuris = ('NF')">NL</xsl:when>
                        <xsl:when test="$legjuris = ('NU')"/>
                        <xsl:otherwise>
                          <xsl:value-of select="$legjuris"/>
                        </xsl:otherwise>
                      </xsl:choose>
                    </xsl:attribute>
                  </lnci:can>
                </lnci:jurisinfo>
              </xsl:when>
              <xsl:otherwise/>
            </xsl:choose>
          </xsl:if>
        </xsl:if>
        <xsl:if test="$streamID = 'CA03' and local-name() = 'hierlev' and not(child::ci:hierlev)">
          <xsl:variable name="beforeslash" select="substring-before(ancestor::source_cttr:body/leg:info/leg:num, '/')"/>
          <xsl:variable name="afterslash" select="substring-after(ancestor::source_cttr:body/leg:info/leg:num, '/')"/>
          <xsl:variable name="fullnumber" select="ancestor::source_cttr:body/leg:info/leg:num"/>
          <xsl:variable name="cicitecount" select="count(ancestor::source_cttr:body/leg:info/leg:officialnum/ci:cite)"/>
          <xsl:variable name="legofnumchild" select="ancestor::source_cttr:body/leg:info/leg:officialnum"/>
          <xsl:if test="contains(ancestor::leg:officialnum/preceding-sibling::leg:num, '/')">
            <xsl:choose>
              <xsl:when test="$cicitecount = 1">
                <lnci:hiertext value="{$beforeslash}"/>
              </xsl:when>
              <xsl:when test="$cicitecount = 2">
                <lnci:hiertext value="{if(not(ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite])) then $beforeslash else $afterslash}"/>
              </xsl:when>
              <xsl:when test="$cicitecount = 4">
                <xsl:if test="not(ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite])">
                  <lnci:hiertext value="{$beforeslash}"/>
                </xsl:if>
                <xsl:if test="ancestor::ci:cite/preceding-sibling::*[1][self::ci:cite] and count(ancestor::ci:cite/preceding-sibling::ci:cite) = 2">
                  <lnci:hiertext value="{$afterslash}"/>
                </xsl:if>
              </xsl:when>
            </xsl:choose>
          </xsl:if>
        </xsl:if>
        <!-- Awantika-21-07-2017- For AU20 remotelink needs to be created outside ci:content -->
        <xsl:choose>
          <xsl:when test="$streamID='AU20' and local-name() = 'content'">
            <xsl:apply-templates select="node() except remotelink"/>
          </xsl:when>
          <xsl:when test="$streamID='CA02DC' and local-name()='content' and ancestor::case:reportercite">
            <xsl:apply-templates select="*"/>
          </xsl:when>
          <xsl:when test="$streamID='CA02CC' and local-name()='content'">
            <xsl:choose>
              <xsl:when test="starts-with(.,'Full text: ')">
                <xsl:value-of select="replace(.,'Full text: ','')"/>
              </xsl:when>
              <xsl:when test="starts-with(.,'Texte intégral :')">
                <xsl:value-of select="replace(.,'Texte intégral :','')"/>
              </xsl:when>
              <xsl:when test="starts-with(.,'Full text/texte intégral: ')">
                <xsl:value-of select="replace(.,'Full text/texte intégral: ','')"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:apply-templates select="node()"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="node()"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:element>
    </xsl:template>
    Template ci:pinpoint/@searchtype
    Documentation

    Description

     JD: 20170524 : added to trap error output message 
    Namespace No namespace
    Match ci:pinpoint/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="ci:pinpoint/@searchtype"/>
    Template ci:*/@*[not(name() = ('searchtype', 'spanref', 'type', 'ID', 'ln.nsprefix'))]
    Namespace No namespace
    Match ci:*/@*[not(name() = ('searchtype', 'spanref', 'type', 'ID', 'ln.nsprefix'))]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="ci:*/@*[not(name() = ('searchtype', 'spanref', 'type', 'ID', 'ln.nsprefix'))]">
      <xsl:attribute name="{name()}">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template ci:volume[@num = ''] | ci:volume[@num = ' '] | ci:page[@num = '']
    Namespace No namespace
    Match ci:volume[@num = ''] | ci:volume[@num = ' '] | ci:page[@num = '']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="ci:volume[@num = ''] | ci:volume[@num = ' '] | ci:page[@num = '']"/>
    Template ci:*/@spanref | ci:*/@ln.nsprefix
    Namespace No namespace
    Match ci:*/@spanref | ci:*/@ln.nsprefix
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="ci:*/@spanref | ci:*/@ln.nsprefix"/>
    Template ci:*/@ID
    Namespace No namespace
    Match ci:*/@ID
    Mode #default
    References
    Parameters
    QName Namespace Tunnel
    increment-caserefid No namespace yes
    Import precedence 0
    Source
    <xsl:template match="ci:*/@ID">
      <xsl:param name="increment-caserefid" tunnel="yes"/>
      <xsl:variable name="dupStatus">
        <xsl:for-each select="parent::*">
          <xsl:call-template name="amIaDuplicate"/>
        </xsl:for-each>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="$dupStatus = 'false'">
          <xsl:attribute name="ID">
            <xsl:call-template name="normalizeIdString"/>
            <xsl:if test="$increment-caserefid = 'yes'">
              <xsl:text>_01</xsl:text>
            </xsl:if>
          </xsl:attribute>
        </xsl:when>
        <xsl:otherwise>
          <xsl:message>citation ID for
            <xsl:value-of select="parent::*"/>was a duplicate and has been removed from the conversion.</xsl:message>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template citefragment | ci:span
    Namespace No namespace
    Match citefragment | ci:span
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="citefragment | ci:span">
      <!-- Sudhanshu : 6 june 2017 , requirement for converting ci:span to lnci:span, so using choose scenario. -->
      <xsl:choose>
        <xsl:when test="$streamID = 'CA03' and not(ancestor::leg:officialnum) and not(ancestor::case:parallelcite)">
          <lnci:span>
            <xsl:apply-templates select="@* | node()"/>
          </lnci:span>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template citefragment[parent::ci:content and remotelink[@service = 'DOC-ID']][$streamID = ('AU04', 'AU08')]
    Documentation

    Description

    <xsl:template
    		match="citefragment[parent::ci:content and remotelink[@service = 'DOC-ID']][$streamID = 'AU04' or $streamID = 'AU08']"> </xsl:template>
    Namespace No namespace
    Match citefragment[parent::ci:content and remotelink[@service = 'DOC-ID']][$streamID = ('AU04', 'AU08')]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Source
    <xsl:template match="citefragment[parent::ci:content and remotelink[@service = 'DOC-ID']][$streamID = ('AU04', 'AU08')]">
      <xsl:call-template name="remotelinkDOCID"/>
    </xsl:template>
    Template citefragment[parent::ci:content and remotelink[@service = 'DOC-ID']][$streamID = ('NZ09', 'NZ07-DN')]
    Namespace No namespace
    Match citefragment[parent::ci:content and remotelink[@service = 'DOC-ID']][$streamID = ('NZ09', 'NZ07-DN')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="citefragment[parent::ci:content and remotelink[@service = 'DOC-ID']][$streamID = ('NZ09', 'NZ07-DN')]">
      <xsl:apply-templates/>
    </xsl:template>
    Template ci:cite[not(ancestor::case:references) or $streamID='NZ17CC' or $streamID='HK09']/@searchtype
    Namespace No namespace
    Match ci:cite[not(ancestor::case:references) or $streamID='NZ17CC' or $streamID='HK09']/@searchtype
    Mode #default
    References
    Variable
    Parameters
    QName Namespace
    childElementName No namespace
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="ci:cite[not(ancestor::case:references) or $streamID='NZ17CC' or $streamID='HK09']/@searchtype" priority="25">
      <xsl:param name="childElementName"/>
      <xsl:choose>
        <!-- JD: 2017-08-01: NZ06 includes standard module id-CCCC-10268; by my reading ci:cite/@type should not be suppressed, only the value 'legref'
    			"If ci:cite@type comes with attribute value "legref" in source document then conversion needs to suppressed attribute value in target 
    			and convert ci:cite according to general rule."
    			Moving this logic to ci:cite/@type, below
    			-->
        <!--<xsl:when test="$streamID = ('NZ06')"/>-->
        <xsl:when test="      $childElementName = 'case' or $childElementName = 'form' or      $childElementName = 'misc' or $childElementName = 'admininterp' or      $childElementName = 'execdoc' or $childElementName = 'annot' or      $childElementName = 'constitution' or $childElementName = 'agencydecision' or      $childElementName = 'oag' or $childElementName = 'book' or      $childElementName = 'pinpoint' or $childElementName = 'periodical' or      $childElementName = 'lawrev' or $childElementName = 'copyright' or      $childElementName = 'tmark' or $childElementName = 'patent' or      $childElementName = 'sesslaw' or $childElementName = 'courtrule' or      $childElementName = 'reg' or $childElementName = 'juryinstr'"/>
        <xsl:otherwise>
          <xsl:attribute name="type">
            <xsl:choose>
              <xsl:when test=". = 'LEG-REF'">legislation</xsl:when>
              <xsl:when test=". = 'CASE-REF'">case</xsl:when>
              <xsl:when test=". = 'BOOK-REF'">book</xsl:when>
              <xsl:when test=". = 'BODY-CASE-REF'">case</xsl:when>
              <xsl:when test=". = 'SUMM-CASE-REF'">case</xsl:when>
              <xsl:when test=". = 'EU-REF'">EU-REF</xsl:when>
            </xsl:choose>
          </xsl:attribute>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template ci:cite/@type
    Namespace No namespace
    Match ci:cite/@type
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="ci:cite/@type">
      <xsl:choose>
        <!-- 
    				"Handling for NZ Regulation and NZ Act from services:
    				If ci:cite@type comes with attribute value "legref" in source document then conversion needs to suppressed attribute value in target 
    			  and convert ci:cite according to general rule."  -->
        <xsl:when test=".='legref' and $streamID=('NZ05','NZ06')"/>
        <!-- do nothing -->
        <xsl:when test=". = 'legref' or parent::ci:cite[ci:case | ci:stat | ci:juryinstr | ci:reg | ci:courtrule | ci:sesslaw | ci:patent | ci:tmark | ci:copyright | ci:lawrev | ci:periodical | ci:pinpoint | ci:book | ci:oag | ci:agencydecision | ci:constitution | ci:annot | ci:execdoc | ci:admininterp | ci:misc | ci:form]"/>
        <xsl:otherwise>
          <xsl:attribute name="type" select="."/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template ci:cite/@searchtype
    Documentation

    Description

     Vikas Rohilla : Added for the error messege	
    Namespace No namespace
    Match ci:cite/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="ci:cite/@searchtype"/>
    Template copyright
    Documentation

    Description

    copyright becomes copyright with optional child

    • copyright.holder becomes copyright-holder.

    Source XML

    
    <copyright>
        ©  
        <copyright.holder>Crown Copyright</copyright.holder> 
    </copyright>
    
    		

    Target XML

    
    <copyright>
         ©  
         <copyright-holder>Crown Copyright</copyright-holder> 
    </copyright>
    
    		

    Source XML

    
    <copyright>
       Copyright © Times Newspapers Ltd and Reed Elsevier (UK) Ltd 2007
    </copyright>
    
    		

    Target XML

    
    <copyright>
         Copyright © Times Newspapers Ltd and Reed Elsevier (UK) Ltd 2007
    </copyright>
    
    		

    Description

     rosetta element: comm-info.contrib.note.p.text 
    <topicref href="../../common_newest/Rosetta_Commentary_text-Chof-comm.info-contrib-note-p-LxAdv-seclaw.prelim-byline-inlinenote.dita"/>
     start topichead  copyright  
     <topicref href="../../common_newest/Rosetta_copyright-LxAdv-copyright.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_copyright-LxAdv-copyright.dita  
     Vikas Rohilla : Initial updated may be changed if required
    Namespace No namespace
    Match copyright
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="copyright">
      <copyright>
        <xsl:apply-templates select="@* | node()"/>
      </copyright>
    </xsl:template>
    Template copyright.holder
    Namespace No namespace
    Match copyright.holder
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="copyright.holder">
      <copyright-holder>
        <xsl:apply-templates select="@* | node()"/>
      </copyright-holder>
    </xsl:template>
    Template credit
    Documentation

    Description

    Instructions [common element]

    credit becomes credit

    Source XML

        
        <blockquote>
          ...
          <credit>(Emphasis added.)</credit>
        </blockquote>
        
        	

    Target XML

        
        <blockquote>
          ...
          <credit>(Emphasis added.)</credit>
        </blockquote>    
        
        	

    Description

     <topicref href="../../common_newest/Rosetta_AU_NZ_copyright-LxAdv-copyright.dita"/> 
    <xsl:include href="../../modules/nonamespace/Rosetta_AU_NZ_copyright-LxAdv-copyright.xsl"/>
    <topicref href="../../common_newest/Rosetta_NZ_copyright-LxAdv-copyright.dita"/>
     end topichead  copyright  
     rosetta element: credit 
     <topicref href="../../common_newest/Rosetta_credit-LxAdv-credit.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_credit-LxAdv-credit.dita  
     Vikas Rohilla : Initial updated may be changed if required
    Namespace No namespace
    Match credit
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="credit">
      <credit>
        <xsl:apply-templates select="@* | node()"/>
      </credit>
    </xsl:template>
    Template date
    Documentation

    Description

    date becomes date comes with following attributes:

    • @month becomes @month is between 01-12. Any numbers outside this range, do not output a @month.
    • @day becomes @day is between 01-31. Any numbers outside this range, do not output @day.
    • @year becomes @year is 4 digits in length. Any other lengths, do not output @year.

    Note: The format of the content of all date elements must be in 'YYYY-MM-DD'.

    Source XML

    
    <p>
    	<text>The paragraph below is current to 
    		<emph typestyle="bf">
    			<date day="11" month="05" year="2010">11 May 2010</date>
    		</emph>
    	</text>
    </p>
    
    		

    Target XML

    
    <p>
    	<text>The paragraph below is current to 
    		<emph typestyle="bf">
    			<date day="11" month="05" year="2010">11 May 2010</date>
    		</emph>
    	</text>
    </p>
    
    		

    Populating the attribute @normdate

    • If one or more of the three date values (year, month or day) are absent, then decision:decisiondate/@normdate should not be populated.
    • The @normdate should be populated with the values of date elements within New Lexis.
    • Using case:decisiondate as an example the ru: case:decisiondate/date/@year, case:decisiondate/date/@month and case:decisiondate/date/@day concatenated and separated by a single hyphen. The values of case:decisiondate/date/@month and case:decisiondate/date/@day should be padded with zeroes so that they are 2 digits.

    Note: The format of the content of all date elements must be in 'YYYY-MM-DD'.

    Source XML

                Source 1	
    
         <admindecision:dates>
             <decision:fileddate  day="8" month="02" year="1989">
                 <date-text>8/2/1989</date-text>
              </decision:fileddate>
         </admindecision:dates>
    
    
    Source 2
    
    		<decision:dates>
               <decision:decisiondate day="8" month="02" year="1989">
                 <date-text>8/2/1989</date-text>
               </decision:decisiondate>
           </decision:dates>
    		
    		
    Source 3
    		
    		
    	<primlawinfo:primlawinfo>
         <primlawinfo:dates>
            <primlawinfo:effdate year="1961" month="06" day="22">
                <date-text>June 22, 1961</date-text>
            </primlawinfo:effdate>
          </primlawinfo:dates>
       </primlawinfo:primlawinfo>
    		
    
    		

    Target XML

                Target 1	
    
       <admindecision:dates>
          <decision:fileddate  day="8" month="02" year="1989" normdate="1989-02-08">
    			<date-text>8/2/1989</date-text>
    		</decision:fileddate>
       </admindecision:dates>
    		
    		
    Target 2
    
    	<decision:decisiondate day="8" month="02" year="1989" normdate="1989-02-08">
    		<date-text>8/2/1989</date-text>
    	</decision:decisiondate>
    		
    		
    Target 3
    		
    		
    	<primlawinfo:dates>
    		<primlawinfo:effdate year="1961" month="06" day="22" normdate="1961-06-22">
    				<date-text>June 22, 1961</date-text>
    		</primlawinfo:effdate>
    	</primlawinfo:dates>
    		
    				
    		

    Description

     rosetta element: date 
     <topicref href="../../common_newest/Rosetta_date-LxAdv-date.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_date-LxAdv-date.dita  
     IMPORTANT NOTE: if your stream wants to put the text content of the date element into a <date-text> wrapper, add 
    		the streamID for your stream into the variable 'streamsThatUseDateTextChild' and it will add
    		the date-text wrapper for that stream 
     Awantika: Following the above instructions modified the template as in few streams date element is not required 
    		but if date is coming in p/text then date element is created. 
     Awantika: added stream AU20 to  streamsThatUseDateTextChild
    Namespace No namespace
    Match date
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Source
    <xsl:template match="date">
      <xsl:variable name="streamsThatUseDateTextChild" select="('HK03','AU01','NZ03','NZ13','CA02DC','UK05','AU20','UK01','UK03','UK11DA','UK12','AU09','UK11DN','UK22CF')"/>
      <xsl:choose>
        <xsl:when test="ancestor::case:dates or $streamID=('CA02DC','AU20','UK11DA','UK12','NZ13','UK11DN','UK22CF')">
          <xsl:choose>
            <xsl:when test="($streamID=$streamsThatUseDateTextChild and parent::entry)">
              <date>
                <xsl:apply-templates select="@*|node()"/>
              </date>
            </xsl:when>
            <xsl:when test="($streamID=$streamsThatUseDateTextChild) and node()">
              <date-text>
                <xsl:apply-templates/>
              </date-text>
            </xsl:when>
            <xsl:when test="not($streamID=$streamsThatUseDateTextChild) and node()">
              <xsl:apply-templates/>
            </xsl:when>
            <!-- JD: 2017-06-27: 
    						Excluding this template from UK01 under case:hearingdates.  
    						
    						date/@* are applied in the case:hearindates template as any attributes
    						must be created before creating any nodes (<date-text>, text() content, etc.)
    						
    						Previously, the 'otherwise' condition would apply to the data below and would 
    						output as @day="06", @month="12" @year="1934; the correct output is 
    						@day="23", @month="01" @year="1935"
    						
    						<case:hearingdates>
    							<date day="29" month="11" year="1934"/>
    							<date day="30" month="11" year="1934"/>
    							<date day="06" month="12" year="1934"/>
    							<date day="13" month="12" year="1934">29, 30 November, 6, 13
    								December 1934</date>
    							<date day="23" month="01" year="1935">23 January 1935</date>
    						</case:hearingdates>
    						-->
            <xsl:when test="$streamID=('UK01','UK03') and (parent::case:hearingdates or parent::case:decisiondate)">
              <!-- do nothing; date attributes have been handled and there is no child node() to process -->
            </xsl:when>
            <xsl:otherwise>
              <!-- just apply attributes -->
              <xsl:apply-templates select="@*"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:otherwise>
          <date>
            <xsl:call-template name="DATE_attributes">
              <xsl:with-param name="date">
                <xsl:copy-of select="."/>
              </xsl:with-param>
            </xsl:call-template>
            <xsl:apply-templates select="node()"/>
          </date>
        </xsl:otherwise>
      </xsl:choose>
      <!--<date xmlns="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
    			<xsl:call-template name="DATE_attributes">
    				<xsl:with-param name="date">
    					<xsl:copy-of select="."/>
    				</xsl:with-param>
    			</xsl:call-template>
    		<!-\-  Original Target XPath:  date   -\->
    		<!-\- Awantika: date becomes date-text if text() is coming else date becomes date in HK03 -\->
    			<xsl:choose>
    				<xsl:when test="($streamID=$streamsThatUseDateTextChild) and node()">
    					<date-text xmlns="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
    						<xsl:apply-templates/>
    					</date-text>
    				</xsl:when>
    				<xsl:when test="not($streamID=$streamsThatUseDateTextChild) and node()">
    					<xsl:apply-templates/>					
    				</xsl:when>
    			</xsl:choose>
    		</date>-->
    </xsl:template>
    Template date[parent::p-limited or ancestor::text][$streamID='UK12']
    Namespace No namespace
    Match date[parent::p-limited or ancestor::text][$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="date[parent::p-limited or ancestor::text][$streamID='UK12']">
      <date>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates select="node()"/>
      </date>
    </xsl:template>
    Template deflist
    Documentation

    Description

    deflist becomes deflist with children as described below:

    defitem becomes defitem.

    defterm becomes defterm.

    defdesc becomes defdesc.

    Note: When defitem contains footenote or fnr as a direct child, place the converted footnote and footnote-ref into either defterm or defdesc. If the footenote or fnr occurs either directly before or directly after defterm, place the footnote in defterm. If the footenote or fnr occurs after defdesc, place the footnote in defdesc.

    Source XML

     <deflist> <defitem> <defterm> <emph
    					typestyle="bf">an entitlement to redundancy pay</emph>
    					</defterm> <defdesc> <p> <text>includes an
    					entitlement for an employee to enter into a retention or redeployment
    					period.</text> </p> </defdesc> </defitem>
    					</deflist> 

    Target XML

     <deflist> <defitem> <defterm> <emph
    					typestyle="bf">an entitlement to redundancy pay</emph>
    					</defterm> <defdesc> <bodytext> <p>
    					<text>includes an entitlement for an employee to enter into a
    					retention or redeployment period.</text> </p>
    					</bodytext> </defdesc> </defitem> </deflist>
    				

    If the markup includes defitem/defterm, but no sibling defitem/defdesc, create a blank defitem/defdesc element after defterm but before any other text (such as a note or annottion). The resulting markup within deflist/defitem must always include a defdesc child to create the proper display to the end user.

    Source XML

     <deflist> <defitem> <defterm> <emph
    					typestyle="bf">FWA</emph> </defterm>
    					<leg:histnote> <p> <text>[def rep Act 174 of 2012 s
    					3 and Sch 9 item 14, effective 1 January 2013]</text> </p>
    					</leg:histnote> </defitem> </deflist> 

    Target XML

     <deflist> <defitem> <defterm> <emph
    					typestyle="bf">FWA</emph> </defterm> <defdesc/>
    					<note notetype="historical"> <bodytext> <p>
    					<text>[def rep Act 174 of 2012 s 3 and Sch 9 item 14, effective
    					1 January 2013]</text> </p> </bodytext>
    					</note> </defitem> </deflist> 

    For narrative content that immediately follows defterm create and wrap the narrative content within defdesc/bodytext/p/text retaining any emph.

    Source XML

     <deflist> <defitem> <p> <text>
    					<defterm> <refpt id="ACT_REG_1932-MAG_FINEDEFAULTER"
    					type="ext"/> <emph typestyle="bf">fine defaulter</emph>
    					</defterm> &mdash;see the <emph
    					typestyle="it">Magistrates Court Act 1930</emph>,
    					section&#160;146. </text> </p> </defitem>
    					<defitem> <p> <text> <defterm> <refpt
    					id="ACT_REG_1932-MAG_OUTSTANDINGFINE" type="ext"/> <emph
    					typestyle="bf">outstanding fine</emph> </defterm>
    					&mdash; see the <emph typestyle="it">Magistrates Court Act
    					1930</emph>, section&#160;146. </text> </p>
    					</defitem> </deflist> 

    Target XML

     <deflist> <defitem> <defterm>
    					<ref:anchor id="ACT_REG_1932-MAG_FINEDEFAULTER"
    					anchortype="global"/> <emph typestyle="bf">fine
    					defaulter</emph> </defterm> <defdesc>
    					<bodytext> <p> <text> &#x2014; see the <emph
    					typestyle="it">Magistrates Court Act 1930</emph>,
    					section&#x00A0;146. </text> </p> </bodytext>
    					</defdesc> </defitem> <defitem> <defterm>
    					<ref:anchor id="ACT_REG_1932-MAG_OUTSTANDINGFINE"
    					anchortype="global"/> <emph typestyle="bf">outstanding
    					fine</emph> </defterm> <defdesc> <bodytext>
    					<p> <text> &#x2014; see the <emph
    					typestyle="it">Magistrates Court Act 1930</emph>,
    					section&#x00A0;146. </text> </p> </bodytext>
    					</defdesc> </defitem> </deflist> 

    Handling of deflist with connector element.

    Source XML

     <deflist> <defitem
    					id="WFW.RL.WRA96.S6..APPLIES"> <defterm> <refpt
    					id="WFW.RL.WRA96.S6..APPLIES" type="ext"/> <emph
    					typestyle="bf">applies</emph> </defterm> :
    					<defdesc> <l> <li id="WFW.RL.WRA96.S6..APPLIES.A">
    					<lilabel> <refpt id="WFW.RL.WRA96.S6..APPLIES.A"
    					type="ext"/>(a) </lilabel> </li> </l>
    					</defdesc> </defitem> </deflist> 

    Target XML

     <deflist> <defitem> <defterm>
    					<ref:anchor id="WFW.RL.WRA96.S6..APPLIES" anchortype="global"/>
    					<emph typestyle="bf">applies</emph> </defterm>
    					<connector>:</connector> <defdesc> <bodytext>
    					<list> <listitem> <ref:anchor
    					id="WFW.RL.WRA96.S6..APPLIES.A" anchortype="global"/>
    					<label>(a)</label> </listitem> </list>
    					</bodytext> </defdesc> </defitem> </deflist>
    				

    If there are more than one defterm in the input documents then it will be handled as:

    Source XML

     <deflist> <defitem> <p> <text>
    					<defterm> <refpt id="VIC_ACT_797_BISHOP" type="ext"/>
    					<emph typestyle="bf">"bishop"</emph> </defterm> or
    					<defterm> <refpt id="VIC_ACT_797_BISHOPOFADIOCESE"
    					type="ext"/> <emph typestyle="bf">"bishop of a
    					diocese"</emph> </defterm> shall mean as to the term
    					"bishop" the bishop registered under the title of "bishop" under the
    					provisions of the "<emph typestyle="bf">Successory Trusts Act
    					1878</emph>" as head of the Church of England in the portion of
    					Victoria described in the certificate of registrations, and shall
    					include the administrator of the affairs of the dioceses during the
    					vacancy of the see; and the term <defterm> <refpt
    					id="VIC_ACT_797_DIOCESE" type="ext"/> <emph
    					typestyle="bf">"diocese"</emph> </defterm> shall mean
    					the portion of Victoria described in such certificate as the diocese
    					of the person so registered; </text> </p> </defitem>
    					</deflist> 

    Target XML

     <deflist> <defitem> <defterm>
    					<ref:anchor id="VIC_ACT_797_BISHOP" anchortype="global"/>
    					<emph typestyle="bf">"bishop"</emph> </defterm>
    					<connector>or</connector> <defterm> <ref:anchor
    					bid="VIC_ACT_797_BISHOPOFADIOCESE" anchortype="global"/> <emph
    					typestyle="bf">"bishop of a diocese"</emph> </defterm>
    					<defdesc> <bodytext> <p> <text> shall mean as
    					to the term "bishop" the bishop registered under the title of "bishop"
    					under the provisions of the "<emph typestyle="bf">Successory
    					Trusts Act 1878</emph>" as head of the Church of England in the
    					portion of Victoria described in the certificate of registrations, and
    					shall include the administrator of the affairs of the dioceses during
    					the vacancy of the see; and the term </text> </p>
    					</bodytext> </defdesc> <defterm> <ref:anchor
    					id="VIC_ACT_797_DIOCESE" anchortype="global"/> <emph
    					typestyle="bf">"diocese"</emph> </defterm>
    					<defdesc> <bodytext> <p> <text> shall mean the
    					portion of Victoria described in such certificate as the diocese of
    					the person so registered; </text> </p> </bodytext>
    					</defdesc> </defitem> </deflist> 

    Handling of defitem/@id and defterm/@id.

    Note:

    For GPL IN Content Stream

    • defitem/@id becomes defitem/@xml:id
    • defterm/@id becomes defterm/@xml:id

    GPL IN Content Stream Source XML

     <deflist> <defitem id="S3.i"> <defterm
    					id="s3.active service">active service</defterm>
    					<defdesc> <p> <text>, as applied to a person subject
    					to this Act, means the time during which such
    					person&#x2014;</text> </p> </defdesc>
    					</defitem> </deflist> 

    GPL IN Content Stream Target XML

     <deflist> <defitem xml:id="S3.i"> <defterm
    					xml:id="s3.active service">active service</defterm>
    					<defdesc> <bodytext> <p> <text>, as applied to
    					a person subject to this Act, means the time during which such
    					person&#x2014;</text> </p> </bodytext>
    					</defdesc> </defitem> </deflist> 

    If the input document has subtitle/defterm scenario then defterm within a subtitle can be dropped, but the child element and content of the tag is retained and no text is dropped.

    Source XML having subtitle/defterm scenario:

     <subtitle> <defterm> <emph
    						typestyle="bf">&#x201C;Greenhouse Gas Storage Act
    						2009&#x201D;</emph> </defterm> </subtitle>
    					

    Target XML

     <subtitle> <emph
    						typestyle="bf">&#x201C;Greenhouse Gas Storage Act
    						2009&#x201D;</emph> </subtitle> 

    Description

     start topichead  deflist  
     <topicref href="../../common_newest/Rosetta_deflist-LxAdv-deflist.dita"/> 
    Namespace No namespace
    Match deflist
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="deflist">
      <!--  Original Target XPath:  deflist   -->
      <deflist>
        <xsl:apply-templates select="@* | node()"/>
      </deflist>
    </xsl:template>
    Template defitem
    Namespace No namespace
    Match defitem
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="defitem">
      <!--  Original Target XPath:  defitem   -->
      <defitem>
        <xsl:apply-templates select="@id"/>
        <xsl:apply-templates select="@* except @id | defterm"/>
        <xsl:if test="not(defdesc | p/text/defdesc) and not(text()[normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = ''])">
          <!-- JL added empty bodytext wrapper to validate to the target schemas -->
          <defdesc>
            <bodytext>
              <xsl:apply-templates/>
            </bodytext>
          </defdesc>
        </xsl:if>
        <xsl:apply-templates select="node() except (footnote | fnr | defterm)"/>
      </defitem>
    </xsl:template>
    Template defitem[$streamID = ('UK06','UK07')]
    Namespace No namespace
    Match defitem[$streamID = ('UK06','UK07')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="defitem[$streamID = ('UK06','UK07')]">
      <defitem>
        <xsl:apply-templates select="@* | defterm"/>
        <xsl:choose>
          <!-- when there is a defdesc apply it -->
          <!-- TODO: find/test p/text/defdesc branch to ensure nothing lost -->
          <xsl:when test="defdesc | p/text/defdesc">
            <xsl:apply-templates select="defdesc | p/text/defdesc"/>
          </xsl:when>
          <!-- when there is no defdesc and text() content that should become the definition -->
          <xsl:when test="not(defdesc | p/text/defdesc)">
            <!-- JL added empty bodytext wrapper to validate to the target schemas -->
            <defdesc>
              <bodytext>
                <xsl:variable name="defvalue" select="./text()[preceding-sibling::defterm and following-sibling::leg:histnote]"/>
                <xsl:apply-templates select="node() except (footnote | fnr | defterm)"/>
              </bodytext>
            </defdesc>
          </xsl:when>
        </xsl:choose>
      </defitem>
    </xsl:template>
    Template defitem[$streamID = ('AU11', 'NZ06', 'NZ10', 'AU18')]
    Documentation

    Description

     JD: Attempting to create single defitem template rule, 
    		   limiting to specific streams for now.
    		   
    		   Handles both <defitem> with <defterm> and <defdesc> and the 		
    			 condition where <defitem> has a <defterm> but no <defdesc>, but has text() containing the definition.
    			
    			Example:
    	
    		<defitem id="IPP.ICON.JRCTL.ART1.OFFICE">
    			<defterm>
    				<refpt id="IPP.ICON.JRCTL.ART1.OFFICE" type="ext"/>
    		  	<emph typestyle="bf">Office</emph>
    		 	</defterm>
    		 	means the agency entrusted by a Member State with the registration of marks;
    		</defitem>
    	
    Namespace No namespace
    Match defitem[$streamID = ('AU11', 'NZ06', 'NZ10', 'AU18')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="defitem[$streamID = ('AU11', 'NZ06', 'NZ10', 'AU18')]">
      <defitem>
        <xsl:choose>
          <xsl:when test="$streamID='AU18' and ./@id = descendant::refpt/@id"/>
          <xsl:otherwise>
            <xsl:apply-templates select="@id"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:apply-templates select="@* except @id | defterm"/>
        <!-- create <connector> if required  -->
        <xsl:apply-templates select="text()[normalize-space(replace(., '^[\t\p{Zs}]+$', '')) !='' and parent::defitem and preceding-sibling::defterm and (following-sibling::defdesc | following-sibling::leg:histnote[$streamID='AU18'])]"/>
        <xsl:choose>
          <!-- when there is a defdesc apply it -->
          <!-- TODO: find/test p/text/defdesc branch to ensure nothing lost -->
          <xsl:when test="defdesc | p/text/defdesc">
            <xsl:apply-templates select="defdesc | p/text/defdesc"/>
          </xsl:when>
          <!-- JD: 2017-12-01: found validation error and DT mismatch after SVN update.  Adding this when but limiting to affected stream for now.  May be more broadly applicable. -->
          <xsl:when test="glp:note and not(defdesc | p/text/defdesc) and normalize-space(replace(., '^[\t\p{Zs}]+$', '')) !='' and $streamID='NZ06'">
            <xsl:apply-templates select="node() except (footnote | fnr | defterm | leg:histnote)"/>
          </xsl:when>
          <!-- when there is no defdesc and text() content that should become the definition -->
          <xsl:when test="not(defdesc | p/text/defdesc) and normalize-space(replace(., '^[\t\p{Zs}]+$', '')) !=''">
            <defdesc>
              <bodytext>
                <p>
                  <text>
                    <xsl:apply-templates select="node() except (footnote | fnr | defterm | leg:histnote)"/>
                  </text>
                </p>
              </bodytext>
            </defdesc>
            <!--<xsl:apply-templates select="child::leg:histnote[$streamID='AU18']"/>-->
          </xsl:when>
          <!-- otherwise nothing to do (e.g., text() is all whitespace-->
          <xsl:otherwise/>
        </xsl:choose>
        <!-- now apply templates to any element other than defterm -->
        <xsl:apply-templates select="* except (defterm | defdesc | p/text/defdesc | glp:note)"/>
      </defitem>
    </xsl:template>
    Template text()[parent::defitem and preceding-sibling::defterm and following-sibling::defdesc][not(matches(., '^[\t\p{Zs}]+$'))]
    Documentation

    Description

     JD: 2017-07-21: although not mentioned in the instructions, id-CCCC-10277 provides a special use case and example for <connector> 
    	if text() contains anything but whitespace (tab, nonbreaking space, line feed) then wrap contents in <connector>
    	
    Namespace No namespace
    Match text()[parent::defitem and preceding-sibling::defterm and following-sibling::defdesc][not(matches(., '^[\t\p{Zs}]+$'))]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="text()[parent::defitem and preceding-sibling::defterm and following-sibling::defdesc][not(matches(., '^[\t\p{Zs}]+$'))]">
      <connector>
        <xsl:value-of select="."/>
      </connector>
    </xsl:template>
    Template text()[parent::defitem and preceding-sibling::defterm][matches(., '^[\t\p{Zs}]+$')]
    Documentation

    Description

     if there is a space char (including nonbreaking) suppress it 
    Namespace No namespace
    Match text()[parent::defitem and preceding-sibling::defterm][matches(., '^[\t\p{Zs}]+$')]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="text()[parent::defitem and preceding-sibling::defterm][matches(., '^[\t\p{Zs}]+$')]"/>
    Template defterm
    Namespace No namespace
    Match defterm
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="defterm">
      <!--  Original Target XPath:  defterm   -->
      <defterm>
        <xsl:apply-templates select="@* | node()"/>
        <xsl:if test="following-sibling::*[1][self::footnote | self::fnr] | preceding-sibling::*[1][self::footnote | self::fnr]">
          <xsl:apply-templates select="following-sibling::*[1][self::footnote | self::fnr] | preceding-sibling::*[1][self::footnote | self::fnr]"/>
        </xsl:if>
      </defterm>
    </xsl:template>
    Template defterm[parent::subtitle]
    Namespace No namespace
    Match defterm[parent::subtitle]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="defterm[parent::subtitle]">
      <xsl:apply-templates select="node()"/>
    </xsl:template>
    Template defdesc
    Namespace No namespace
    Match defdesc
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="defdesc">
      <!--  Original Target XPath:  defdesc   -->
      <defdesc>
        <xsl:apply-templates select="@*"/>
        <bodytext>
          <xsl:apply-templates select="node()"/>
        </bodytext>
        <xsl:if test="following-sibling::*[1][self::footnote | self::fnr]">
          <xsl:apply-templates select="following-sibling::*[1][self::footnote | self::fnr]"/>
        </xsl:if>
      </defdesc>
    </xsl:template>
    Template text[child::deflist]
    Documentation

    Description

    When the source has deflist/defitem/p/text then omit p/text and retain defitem.

    Source XML

    
    <deflist>
        <defitem>
            <p>
                <text>
                    <defterm>
                        <refpt id="ACT_REG_1932-MAG_FINEDEFAULTER" type="ext"/>
                        <emph typestyle="bf">fine defaulter</emph>
                    </defterm>&mdash;see the <emph typestyle="it">Magistrates Court Act 1930</emph>,
                    section&#160;146.
                </text>
            </p>
        </defitem>
        <defitem>
            <p>
                <text>
                    <defterm>
                        <refpt id="ACT_REG_1932-MAG_OUTSTANDINGFINE" type="ext"/>
                        <emph typestyle="bf">outstanding fine</emph>
                    </defterm>&mdash; see the <emph typestyle="it">Magistrates Court Act 1930</emph>,
                    section&#160;146.
                </text>
            </p>
        </defitem>
    </deflist>
    
    
                

    Target XML

    
    <deflist>
        <defitem>
            <defterm>
                <ref:anchor id="ACT_REG_1932-MAG_FINEDEFAULTER" anchortype="global"/>
                <emph typestyle="bf">fine defaulter</emph>
            </defterm>
            <defdesc>
                <bodytext>
                    <p>
                        <text> &#x2014; see the <emph typestyle="it">Magistrates Court Act 1930</emph>, section&#x00A0;146.</text>
                    </p>
                </bodytext>
            </defdesc>     
        </defitem>
        <defitem>
            <defterm>
                <ref:anchor id="ACT_REG_1932-MAG_OUTSTANDINGFINE" anchortype="global"/> 
                <emph typestyle="bf">outstanding fine</emph>
            </defterm>
            <defdesc>
                <bodytext>
                    <p>
                        <text>&#x2014; see the <emph typestyle="it">Magistrates Court Act 1930</emph>, section&#x00A0;146.</text>
                    </p>
                </bodytext>
            </defdesc>
        </defitem>
    </deflist>
    
                

    Description

    If the source XML has the scenario p/text/deflist then drop the text tag, i.e., p/text/deflist becomes p/deflist.

    Source XML

    
    <p>
        <text>
            <deflist>
                <defitem>
                    <p>
                        <text>
                            <defterm><emph typestyle="bf">Australian Standard 1885.1</emph></defterm> means
                            Australian Standard 1885, being that standard as approved 20 March 1990 and published 11 
                            June 1990 entitled &#x2018;Workplace injury and disease recording standard&#x2019;.
                        </text>
                    </p>
                </defitem>
            </deflist>
        </text>
    </p>
    
                

    Target XML

    
    <p>
        <deflist>
            <defitem>
                <defterm>
                    <emph typestyle="bf">Australian Standard 1885.1</emph>
                </defterm>
                <defdesc>
                    <bodytext>
                        <p>
                            <text>means Australian Standard 1885, being that 
                                standard as approved 20 March 1990 and published 11 June 1990 entitled 
                                &#x201C;Workplace injury and disease recording standard&#x201D;.
                            </text>
                        </p>
                    </bodytext>
                </defdesc>
            </defitem>
        </deflist>
    </p>
    
                

    Special Scenario: If source document having "p/text/deflist" with running text which is comes before starting of deflist element and under text markup then conversion should not drop text markup in target and retain running text under text and closing of text markup before deflist in target document. Refer below source and target examples:

    Source XML

                    
    <p>
        <text>In these Rules&#x2014;
            <deflist>
                <defitem>
                    ...
                </defitem>
            </deflist>
        </text>
    </p>
    
    
                

    Target XML

                    
    <p>
        <text>In these Rules—</text>
        <deflist>
            <defitem>
                …
            </defitem>
        </deflist>
    </p>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_glp.note-Chof-deflist_defitem-LxAdv-deflist_defitem_defdesc_bodytext_note.dita"/> 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    <xsl:include
    		href="../../modules/glp/Rosetta_glp.note-Chof-deflist_defitem-LxAdv-deflist_defitem_defdesc_bodytext_note.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_text-Chof-deflist_defitem_p-LxAdv-deflist_defitem.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_text-Chof-deflist_defitem_p-LxAdv-deflist_defitem.dita  
     Paul:  this functionality is in the deflist-to-deflist common module Rosetta_deflist_LxAdv_deflist_common_handling_test.xsl 
            
            <xsl:template match="deflist/defitem/p" priority="25">
    		<!-\-  Original Target XPath:  deflist/defitem   -\->
    	    <deflist xmlns="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
    			<defitem>
    				<xsl:apply-templates select="node()"/>
    			</defitem>
    		</deflist>
    	</xsl:template>
    
        <xsl:template match="deflist/defitem/p/text" priority="25"> 
             <xsl:apply-templates select="node()"/>
        </xsl:template>
    
     <topicref href="../../common_newest/Rosetta_deflist-Chof-p_text-LxAdv-p_deflist.dita"/> 
    Namespace No namespace
    Match text[child::deflist]
    Mode #default
    Import precedence 0
    Priority 1
    Source
    <xsl:template match="text[child::deflist]" priority="1">
      <!--  Original Target XPath:  text   -->
      <xsl:for-each-group select="node()" group-adjacent="if (self::deflist) then 0 else 1">
        <xsl:choose>
          <xsl:when test="current-grouping-key()=0">
            <xsl:for-each select="current-group()">
              <xsl:apply-templates select="."/>
            </xsl:for-each>
          </xsl:when>
          <xsl:otherwise>
            <text>
              <xsl:for-each select="current-group()">
                <xsl:apply-templates select="."/>
              </xsl:for-each>
            </text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each-group>
    </xsl:template>
    Template desig[not(parent::p)]
    Documentation

    Description

    desig becomes desig.

    Optional attribute @value becomes @value.

    Optional attribute @inline becomes @inline.

    Drop any remaining attributes.

    Please also see the instructions in edpnum regarding the occurrence of both desig and edpnum as sibling elements within the same parent element.

    Source XML

    
    <desig>
        <designum>2200002817</designum>
    </desig>
    
                

    Target XML

    
    <desig>2200002817</desig>
    
                

    Description

    <topicref href="../../common_newest/Rosetta_AU_Commentary_Forms_Precedents_deflist-LxAdv-deflist.dita"/>
     end topichead  deflist  
     start topichead  desig  
     <topicref href="../../common_newest/Rosetta_desig-LxAdv-desig.dita"/> 
     **************** 
     MDS Be sure to include Rosetta_designum-Chof-desig-LxAdv-desig.xsl in any driver that includes this module. 
     **************** 
     Awantika: desig sibling of title becomes toc-ref in AU01 
     Awantika: to resolve the ambiguity between Rosetta_desig-LxAdv-desig_ref.para and Rosetta_desig-LxAdv-desig updated the template match witn not(parent::p) 
        as if desig is in the heading then it will convert ot desig if inside p then it will convert to ref:para. Removed toc-ref as it will bw mapped in toc module.
        
    Namespace No namespace
    Match desig[not(parent::p)]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="desig[not(parent::p)]">
      <!--  Original Target XPath:  desig   -->
      <desig>
        <!-- Awantika: created desig @value to get the value from designum and should not get the value of designum in text of desig
    	               rather only desiglabel text is populated inside desig-->
        <xsl:choose>
          <xsl:when test="$streamID='AU20'">
            <xsl:attribute name="value">
              <xsl:value-of select="child::designum"/>
            </xsl:attribute>
            <xsl:apply-templates select="node() except designum"/>
          </xsl:when>
          <!-- $streamID=('NZ11','AU10')
    	                        when @id appears on designum, get error.  I suspect any stream would get this error, but 
    	                            because this is common I opted for using stream ID.  If you get this error, consider this.
    	                            Description: XTDE0410: An attribute node (xml:id) cannot be created after a child of the containing element."
    	                            -->
          <xsl:when test="$streamID=('NZ11','AU10') and designum">
            <xsl:apply-templates select="@value | @inline | designum/@id"/>
            <xsl:apply-templates select="*"/>
          </xsl:when>
          <xsl:when test="$streamID=('NZ11','AU10') and not(designum)">
            <xsl:apply-templates select="@value | @inline"/>
            <xsl:apply-templates select="node()"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="@value | @inline | node()"/>
          </xsl:otherwise>
        </xsl:choose>
      </desig>
    </xsl:template>
    Template desig/@value | desig/@inline
    Namespace No namespace
    Match desig/@value | desig/@inline
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="desig/@value | desig/@inline">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template desiglabel
    Documentation

    Description

    desig/desiglabel becomes desig.

    When combining desiglabel and designum the whitespace between should be retained. E.g "Part " and "1&nbsp;&nbsp;&nbsp;" becomes "Part 1&nbsp;&nbsp;&nbsp;".

    For UK Streams: If source does not have whitespace between, then insert single space. If contents of source elements are wrapped in emph then space is required at end of label content or start of number content; if neither space present, insert single space at end of label content.

    Note: The element refptshould be suppressed

    Source XML 1: retain space

     
    <desig searchtype="PART-NUM">
        <desiglabel><refpt type="ext" id="A2008L1_PART_1"/>Part </desiglabel>
        <designum>1&#160;&#160;&#160;</designum>
    </desig>
    
    	

    Target XML 1: retain space

    
    <desig>Part 1&#160;&#160;&#160;</desig>
    
    	

    Source XML 2: insert space

     
    <desig>
        <desiglabel>Division</desiglabel>
        <designum>12</designum>
    </desig>
    
    	

    Target XML 2: insert space

    
    <desig>Division 12</desig>
    
    	

    Source XML 3: insert space within emph

     
    <desig>
        <desiglabel><emph typestyle="bf">Section</emph></desiglabel>
        <designum><emph typestyle="bf">15<emph typestyle="it">(a)</emph></emph></designum>
    </desig>
    
    	

    Target XML 3: insert space within emph

    (space inserted at end of emph holding label content)

    
    <desig><emph typestyle="bf">Section </emph><emph typestyle="bf">15<emph typestyle="it">(a)</emph></emph></desig>
    
    	

    Description

     edpnum has it's own element as sibling, and its own module. no need to affect this node. 
     <topicref href="../../common_newest/Rosetta_desiglabel-Chof-desig-LxAdv-desig.dita"/> 
    Namespace No namespace
    Match desiglabel
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="desiglabel">
      <xsl:choose>
        <xsl:when test="parent::desigrange and $streamID='UK06'">
          <desig>
            <xsl:apply-templates select="node() except(refpt)"/>
            <!-- MDS created in HK04 but not applicable until UK06, 07, 12.  Retest with live data. -->
            <xsl:choose>
              <xsl:when test="following-sibling::designum and (not(ends-with(., ' ')) or not(starts-with(following-sibling::designum, ' ')))">
                <xsl:text> </xsl:text>
              </xsl:when>
              <xsl:when test="emph and following-sibling::designum/emph">
                <xsl:choose>
                  <xsl:when test="(not(ends-with(emph, ' ')) or not(starts-with(following-sibling::designum/emph, ' ')))">
                    <xsl:text> </xsl:text>
                  </xsl:when>
                  <xsl:otherwise/>
                </xsl:choose>
              </xsl:when>
              <xsl:otherwise/>
            </xsl:choose>
            <!--<xsl:apply-templates select="@* | node()"/>-->
            <xsl:apply-templates select="following-sibling::designum"/>
          </desig>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="node() except(refpt)"/>
          <!-- MDS created in HK04 but not applicable until UK06, 07, 12.  Retest with live data. -->
          <xsl:choose>
            <xsl:when test="following-sibling::designum and (not(ends-with(., ' ')) or not(starts-with(following-sibling::designum, ' ')))">
              <xsl:text> </xsl:text>
            </xsl:when>
            <xsl:when test="emph and following-sibling::designum/emph">
              <xsl:choose>
                <xsl:when test="(not(ends-with(emph, ' ')) or not(starts-with(following-sibling::designum/emph, ' ')))">
                  <xsl:text> </xsl:text>
                </xsl:when>
                <xsl:otherwise/>
              </xsl:choose>
            </xsl:when>
            <xsl:otherwise/>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template desig/designum
    Documentation

    Description

    desig/designum becomes desig.

    Source XML

    
    <desig>
        <designum>2200002817</designum>
    </desig>
    
    	

    Target XML

    
    <desig>2200002817</desig>
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_designum-Chof-desig-LxAdv-desig.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_designum-Chof-desig-LxAdv-desig.dita  
     JL note from dita for HK05
        
        *********************************************************************
                    <note>If <sourcexml>dict:body/heading/desig/designum</sourcexml> have
                        <sourcexml>refpt</sourcexml> as child then move target mapping of
                        <sourcexml>refpt</sourcexml> to
                        <targetxml>dict:body/dict:defitem/tei:entry/tei:form/tei:orth/ref:anchor</targetxml></note>
        **********************************************************************
     ******************************************************************************************
            IMPORTANT NOTE!
        The  template for desig (match = "desig") SHOULD NOT BE IN THIS MODULE.
        
        That template (which used to be here)  has a conflict with the module for desig : 
        /XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_desig-LxAdv-desig.xsl
        
        Having the template for desig in this module caused over 1500 ambiguity errors in one test run.
        
        If you need a template for desig to go with designum, which you probably do, 
        please import the desig module for generic handling
        (/XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_desig-LxAdv-desig.xsl) 
        into your driver if it is not already there.  If you need specialized handing, please
        create a separate module for the desig template.
        
        Thanks, JL
        ********************************************************************************************** 
    Namespace No namespace
    Match desig/designum
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="desig/designum">
      <xsl:choose>
        <xsl:when test="$streamID='HK05' and parent::desig/parent::heading/parent::source_dict:body">
          <xsl:apply-templates select="@* | node() except refpt"/>
          <xsl:apply-templates select="refpt" mode="hk05desig"/>
        </xsl:when>
        <!-- $streamID=('NZ11','AU10')
    	                        when @id appears on designum, get error.  I suspect any stream would get this error, but 
    	                            because this is common I opted for using stream ID.  If you get this error, consider this.
    	                            Description: XTDE0410: An attribute node (xml:id) cannot be created after a child of the containing element."
    	                            -->
        <xsl:when test="$streamID=('NZ11','AU10')">
          <xsl:apply-templates select="node() except refpt"/>
        </xsl:when>
        <xsl:otherwise>
          <!-- <xsl:apply-templates select="@* | node()"/>-->
          <!-- Awantika: ref:anchor is not allowed in desig -->
          <xsl:apply-templates select="@* | node() except refpt"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template refpthk05desig
    Namespace No namespace
    Match refpt
    Mode hk05desig
    Import precedence 0
    Source
    <xsl:template match="refpt" mode="hk05desig">
      <xsl:apply-templates/>
    </xsl:template>
    Template dispformula
    Documentation

    Description

    dispformula becomes formula

    • frac becomes frac
      • numer becomes numer is the required child element for frac.
      • denom becomes denom is the required child element for frac.

    Source XML

    
    <dispformula>
        <frac>
            <numer>2 &times; P &times; (J &minus; A)</numer>
            <denom>J</denom>
        </frac>
    </dispformula>
    	
                

    Target XML

    
    <formula>
        <frac>
             <numer>2 &#x00D7; P &#x00D7; (J &#x2212; A)</numer>
             <denom>J</denom>
        </frac>
    </formula>
    
    		  

    Description

     end topichead  desig  
     rosetta element: dispformula 
     <topicref href="../../common_newest/Rosetta_dispformula-LxAdv-formula.dita"/> 
    Namespace No namespace
    Match dispformula
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="dispformula">
      <!--  Original Target XPath:  formula   -->
      <formula>
        <xsl:apply-templates select="@* | node()"/>
      </formula>
    </xsl:template>
    Template edpnum
    Documentation

    Description

    Instructions [common element]

    • If edpnum does not occur as a sibling of desig, then edpnum becomes desig.
    • If edpnum and desig occur as siblings, then edpnum becomes altdesig. This scenario can occur in elements such as leg:heading.
    • In either case, preserve source document order in the output.

    Source XML

    
    <heading>
      <edpnum>[LEN 5638]</edpnum>
      <title>EPA v Multiplex Constructions Pty Ltd</title>
    </heading>
    
    	

    Target XML

    
    <heading>
      <desig>[LEN 5638]</desig>
      <title>EPA v Multiplex Constructions Pty Ltd</title>
    </heading>
    
    	

    Source XML - sibling edpnum and desig

    
    <leg:heading inline="true">
        <edpnum>[78,025]</edpnum>
        <title searchtype="SECT-TITLE">Children's evidence to which this Act applies</title>
        <desig searchtype="SECT-NUM"><designum>6</designum></desig>
    </leg:heading>
    
    	

    Target XML - sibling edpnum and desig

    
    <heading inline="true">
        <altdesig>[78,025]</altdesig>
        <title>Children's evidence to which this Act applies</title>
        <desig>6</desig>    
    </heading>
    
    
    	

    Note: If pnum and edpnum occur as siblings, then edpnum becomes altdesig This scenario can occur in elements such as p(applicable for UK22CS and UK06).

    Source XML - sibling pnum and edpnum

    
    <p>
        <pnum>1 (1)</pnum>
        <edpnum value="F1.302" inline="false">[F1.302]</edpnum>         
    </p>
    
    	

    Target XML edpnum becomes altdesig

    
    <p>
        <desig>1 (1)</desig>
        <altdesig value="F1.302" inline="false">[F1.302]</altdesig>         
    </p>
    
    	

    Description

     MDS 2017-04-20 - This templates is already defined in '/nonamespace/Rosetta_frac-LxAdv-num_frac.xsl' 
    	<xsl:template match="frac">
    
    		<!-\-  Original Target XPath:  frac   -\->
    		<frac>
    			<xsl:apply-templates select="@* | node()"/>
    		</frac>
    
    	</xsl:template>
     MDS 2017-04-20 - This templates is already defined in '/nonamespace/Rosetta_frac-LxAdv-num_frac.xsl' 
    <xsl:template match="numer">
    
    		<!-\-  Original Target XPath:  numer   -\->
    		<numer>
    			<xsl:apply-templates select="@* | node()"/>
    		</numer>
    
    	</xsl:template>
     MDS 2017-04-20 - This templates is already defined in '/nonamespace/Rosetta_frac-LxAdv-num_frac.xsl' 
    <xsl:template match="denom">
    
    		<!-\-  Original Target XPath:  denom   -\->
    		<denom>
    			<xsl:apply-templates select="@* | node()"/>
    		</denom>
    
    	</xsl:template>
     rosetta element: edpnum 
     <topicref href="../../common_newest/Rosetta_edpnum-LxAdv-desig.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_edpnum-LxAdv-desig.dita  
    <xsl:message>Rosetta_edpnum-LxAdv-desig.xsl requires manual development!</xsl:message>
     Awantika- added namespace attribute to the element 
     Made sure refpt and its contents are suppressed as invalid in desig/altdesig; allow other child elements to convert over by applying templates. JL 
     CSN: Created epdnum template 
    Namespace No namespace
    Match edpnum
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="edpnum">
      <xsl:choose>
        <xsl:when test="../desig or ../pnum">
          <xsl:element name="altdesig" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
            <xsl:apply-templates select="@*|node() except refpt"/>
          </xsl:element>
        </xsl:when>
        <xsl:otherwise>
          <xsl:element name="desig" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
            <xsl:apply-templates select="@*|node() except refpt"/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template edpnum/@inline[$streamID=('UK07')]
    Namespace No namespace
    Match edpnum/@inline[$streamID=('UK07')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="edpnum/@inline[$streamID=('UK07')]">
      <xsl:attribute name="inline" select="."/>
    </xsl:template>
    Template edpnum/@value[$streamID=('UK07')]
    Namespace No namespace
    Match edpnum/@value[$streamID=('UK07')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="edpnum/@value[$streamID=('UK07')]">
      <xsl:attribute name="value" select="."/>
    </xsl:template>
    Template edpnum/@inline[$streamID=('UK06','AU14','UK22CF')] | edpnum/@value[$streamID=('UK06','UK22CF')]
    Namespace No namespace
    Match edpnum/@inline[$streamID=('UK06','AU14','UK22CF')] | edpnum/@value[$streamID=('UK06','UK22CF')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="edpnum/@inline[$streamID=('UK06','AU14','UK22CF')] | edpnum/@value[$streamID=('UK06','UK22CF')]"/>
    Template edpnum/@ln.user-displayed
    Namespace No namespace
    Match edpnum/@ln.user-displayed
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="edpnum/@ln.user-displayed"/>
    Template email
    Documentation

    Description

    Instructions [common element]

    email becomes contact:email.

    The attributes and content of contact:email are populated as follows:

    • The value of email/remotelink/@href with the prefix "mailto:" should be placed in contact:email/@normval.
    • The content of email/remotelink should be placed in contact:email.

    Source XML

    
    <email>
        <remotelink href="rtu@services.nsw.gov.au" hrefclass="mailto">rtu@services.nsw.gov.au</remotelink>
    </email>
    
    	

    Target XML

    
    <contact:email normval="mailto:rtu@services.nsw.gov.au">rtu@services.nsw.gov.au
    </contact:email>
    
    	

    If emph occurs within email/remotelink then emph should be suppressed from conversion.

    Source XML

    
    <email>
        <remotelink href="Oliver@simplychateau.com" hrefclass="mailto">
            <emph typestyle="it">Oliver@simplychateau.com</emph> 
        </remotelink>
    </email>
    
    	

    Target XML

    
    <contact:email normval="mailto:Oliver@simplychateau.com">
        Oliver@simplychateau.com
    </contact:email>
    
    	

    Description

     rosetta element: email 
     <topicref href="../../common_newest/Rosetta_email-LxAdv-email.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_email-LxAdv-email.dita  
     CSN: Created mail template 
    Namespace No namespace
    Match email
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="email">
      <xsl:element name="contact:email">
        <xsl:attribute name="normval">
          <xsl:value-of select="./remotelink/@hrefclass"/>
          <xsl:text>:</xsl:text>
          <xsl:value-of select="./remotelink/@href"/>
        </xsl:attribute>
        <xsl:value-of select="string-join(remotelink , '')"/>
      </xsl:element>
    </xsl:template>
    Template email[$streamID='UK12']
    Documentation

    Description

     Vikas Rohilla : Added for the UK12   
    Namespace No namespace
    Match email[$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="email[$streamID='UK12']">
      <xsl:element name="contact:email">
        <xsl:choose>
          <xsl:when test="child::remotelink">
            <xsl:attribute name="normval">
              <xsl:value-of select="./remotelink/@hrefclass"/>
              <xsl:text>:</xsl:text>
              <xsl:value-of select="./remotelink/@href"/>
            </xsl:attribute>
            <xsl:value-of select="string-join(remotelink , '')"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="@*|node()"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:element>
    </xsl:template>
    Template emphemph-generic
    Documentation

    Description

    Instructions [common element]

    emph becomes emph. @typestyle values are tokenized. These are given below:

    • @typestyle="bf" bold.
    • @typestyle="biu" bold, italic and underline.
    • @typestyle="bu" bold underline.
    • @typestyle="caps" capital characters.
    • @typestyle="dbl-un" double underline.
    • @typestyle="grayscal" grayscale.
    • @typestyle="hi" highlighted.
    • @typestyle="ib" italic and bold.
    • @typestyle="it" italic.
    • @typestyle="iu" italic underline.
    • @typestyle="ro" roman.
    • @typestyle="smcaps" small caps.
    • @typestyle="un" underline.
    • @typestyle="inherit" inherit.

    Children of emph should be processed.

    Source XML

    
    <emph typestyle="ro">(1)</emph>
    
    	

    Target XML

    
    <emph typestyle="ro">(1)</emph>
    
    	

    Note: If emph/emph has the same @typestyle value then remove one emph element.

    Note:

    heading/title/emph becomes heading/title. That is, the emph start-tag and end-tag (but not the content) are dropped, and the content becomes part of the target parent title element.

    emph/inlineobject becomes figure/ref:inlineobject.

    h/emph/inlineobject becomes emph/ref:inlineobject.

    sup/emph/emph/inlineobject becomes sup/emph/ref:inlineobject.

    Source XML

                    
                    <heading>
                    <title>
                    <emph typestyle="bf">Judgment</emph>
                    </title>
                    </heading>
                    
                

    Target XML

                    
                    <heading>
                    <title>
                    Judgment
                    </title>
                    </heading>
                    
                

    Source XML: For multiple emph elements

                    
                    <heading>
                    <title>
                    <emph typestyle="bf">
                    <emph typestyle="bf">
                    Doc. 5.27 - Section 10(<emph typestyle="it"><emph typestyle="it">b</emph></emph>) &#x2014; Affidavit
                    </emph>
                    </emph>
                    </title>
                    </heading>
                    
                

    Target XML

                    
                    <heading>
                    <title>Doc. 5.27 - Section 10(b) &#x2014; Affidavit</title>
                    </heading>
                    
                

    Source XML: Showing an emph that contains a child element

                    
                    <heading>
                    <title>
                    <emph typestyle="bf">Non-residential building—(<ci:cite searchtype="LEG-REF" status="invalid">
                    <ci:sesslaw>
                    <ci:sesslawinfo>
                    <ci:sesslawnum num="1994_23a"/>
                    <ci:hierpinpoint><ci:hierlev label="schedule" num="8"/></ci:hierpinpoint>
                    </ci:sesslawinfo>
                    <ci:sesslawref><ci:standardname normpubcode="UK_ACTS"/></ci:sesslawref>
                    </ci:sesslaw>
                    <ci:content>VATA 1994, Schedule 8, group 5</ci:content></ci:cite>, note 7A)</emph>
                    </title>
                    </heading>
                    
                

    Target XML

                    
                    <heading>
                    <title>Non-residential building—(<lnci:cite searchtype="LEG-REF" status="invalid">
                    <lnci:sesslaw>
                    <lnci:sesslawinfo>
                    <lnci:sesslawnum num="1994_23a"/>
                    <lnci:hierpinpoint><lnci:hierlev label="schedule" num="8"/></lnci:hierpinpoint>
                    </lnci:sesslawinfo>
                    <lnci:sesslawref><lnci:standardname normpubcode="UK_ACTS"/></lnci:sesslawref>
                    </lnci:sesslaw>
                    <lnci:content>VATA 1994, Schedule 8, group 5</lnci:content></lnci:cite>, note 7A)</title>
                    </heading>
                    
                

    Source XML: When source is having emph and PCDATA under heading/title than in that case the emph element get dropped from target and its content along with the PCDATA will be put directly under title element.

                    
                    <heading>
                    <title>
                    <emph typestyle="it">R</emph>(on the application of Green) v Police Complaints Authority
                    <fnr fnrtoken="d30e128" fntoken="d30e1108">13</fnr>
                    </title>
                    </heading>
                    
                

    Target XML

                    
                    <heading>
                    <title>R (on the application of Green) v Police Complaints Authority
                    <footnote-ref anchoridref="d30e128">
                    <ref:anchor id="d30e1108"/>
                    <label>13</label>
                    </footnote-ref>   
                    </title>
                    </heading>
                    
                

    emph/sub/inlineobject becomes figure/ref:inlineobject.


    Description

     start topichead  emph  
     <topicref href="../../common_newest/Rosetta_emph-LxAdv-emph.dita"/> 
    Namespace No namespace
    Match emph
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="emph" name="emph-generic">
      <xsl:choose>
        <!-- pass through when parent is title with heading parent or parent is emph with parent title with parent title-->
        <xsl:when test="(child::copyright and parent::disclaimer and $streamID='UK11DA')">
          <xsl:element name="emph">
            <xsl:copy-of select="@typestyle"/>
            <xsl:apply-templates select="@*|node() except copyright"/>
          </xsl:element>
        </xsl:when>
        <xsl:when test="parent::title/parent::heading[$streamID='UK07']">
          <xsl:element name="emph">
            <xsl:copy-of select="@typestyle"/>
            <xsl:apply-templates/>
          </xsl:element>
        </xsl:when>
        <!-- 2016-10-24 - MDS: Pass through when child outputting as URL in UK11DA -->
        <xsl:when test="parent::remotelink[$streamID='UK11DA']">
          <xsl:apply-templates select="node()"/>
        </xsl:when>
        <!-- JD: excluding the dropping of <emph> within title for streams to match DT output.  
                        			There is no instruction to remove <emph> from <title> in 
                        		 emph to emph (id-CCCC-10316)
                        		 title to title (id-CCCC-10479)
                        		-->
        <xsl:when test="$streamID=('AU11','NZ06','NZ08','NZ18','NZ11','NZ13','AU14') and (parent::title/parent::heading                       |parent::emph/parent::title/parent::heading                       | parent::title/parent::leg:heading                       |parent::emph/parent::title/parent::leg:heading) and (not(preceding-sibling::text()) or not(following-sibling::text()))                       ">
          <!-- not in CI, but match DT output: when parent emph is same, merge -->
          <xsl:choose>
            <!-- pass through when there is a parent emph with the same @typestyle -->
            <xsl:when test="@typestyle=parent::emph/@typestyle">
              <xsl:apply-templates/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:element name="emph">
                <xsl:copy-of select="@typestyle"/>
                <xsl:apply-templates/>
              </xsl:element>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:when test="(parent::title/parent::heading                             |parent::emph/parent::title/parent::heading                             | parent::title/parent::leg:heading                             |parent::emph/parent::title/parent::leg:heading) and (not(preceding-sibling::text()) or not(following-sibling::text()))                             ">
          <xsl:apply-templates/>
        </xsl:when>
        <!--skip over emphasis if only refpt at child -->
        <xsl:when test="refpt and not(normalize-space(string-join(text(), '')))[$streamID!='CA10']">
          <!-- suppress -->
        </xsl:when>
        <xsl:when test="@typestyle=parent::emph/@typestyle">
          <!-- pass through when there is a parent emph with the same @typestyle -->
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:when test="child::inlineobject and not(parent::h) and $streamID='AU08'">
          <xsl:apply-templates/>
        </xsl:when>
        <!-- The handling for AU06 could be shareable but keeping as stream-specific until we have more testing. -->
        <!-- JD: 2017-07-19: tested with UK01 too (added); this appears to be working properly.  
                        			Note that the following 'when' drops text() that should be emphasized -->
        <xsl:when test="child::inlineobject and not(parent::h) and ($streamID=('AU06','AU04','UK01','HK02'))">
          <!-- this attempts to allow the emphasis markup to be retained around some output but not around others. -->
          <!-- keep current emph node to get to later. -->
          <xsl:variable name="me" select="."/>
          <xsl:for-each-group select="node()" group-adjacent="if (self::inlineobject) then 0 else 1">
            <xsl:choose>
              <!-- anything here is not kept within emphasis. -->
              <xsl:when test="current-grouping-key()=0">
                <xsl:apply-templates select="current-group()"/>
              </xsl:when>
              <!-- the otherwise condition allows the retention of the emphasis markup. -->
              <xsl:otherwise>
                <emph>
                  <!-- build @typestyle using the input node's @typestyle. -->
                  <xsl:copy-of select="$me/@typestyle"/>
                  <xsl:apply-templates select="current-group()"/>
                </emph>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each-group>
        </xsl:when>
        <!-- JD: Note that this template will drop any text() appearing in emph, as in "Declared takings (F)"  
                        		<emph typestyle="bf">Declared takings (F) 
                        		   <inlineobject type="image" mimetype="image/gif" filename="VATC_19761_1.gif"/>
                        	  </emph>
                        		-->
        <xsl:when test="child::inlineobject and not(parent::h) and not ($streamID='UK09')">
          <!-- AS: for emph/inlineobject in DT GDS it's emph/ref:inlineobject but in CI it's figure/ref:inlineobeject -->
          <xsl:element name="figure">
            <xsl:apply-templates/>
          </xsl:element>
        </xsl:when>
        <xsl:when test="child::sub/child::inlineobject">
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:when test="ancestor::ci:content[$streamID='CA02DS']">
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:element name="emph">
            <xsl:copy-of select="@typestyle"/>
            <xsl:apply-templates/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template emph/@typestyle
    Documentation

    Description

    suppress to get rid of errors as @typestyle already handled. JL 
    Namespace No namespace
    Match emph/@typestyle
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="emph/@typestyle"/>
    Template emph[parent::case:judges and ./@typestyle='smcaps']
    Documentation

    Description

    Instructions [common element]

    When emph is inside case:judges and @typestyle="smcaps" then conversion need to omit emph tag.

    Source XML

    					<case:judgment>
    					  <case:courtinfo>
    					      <case:judges>
    					          JUDGE M 
    					          <emph typestyle="smcaps">c</emph> 
    					          ELREA. 
    					      </case:judges>
    					  </case:courtinfo>
    					  ...
    					</case:judgment>
            	    

    Target XML

    					<courtcase:opinion>
    					  <courtcase:opinionby>
    					    JUDGE M 
    					    c
    					    ELREA. 
    					  </courtcase:opinion>
    					</courtcase:opinion>
            	    

    Description

     <topicref href="../../common_newest/Rosetta_emph-Chof-case.judges-LxAdv-omit_tag.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_emph-Chof-case.judges-LxAdv-omit_tag.dita  
     20170424:  MCJ:  Handled to match the conversion instructions.  However, it feels like this would be better placed in a single module that handles emph to avoid spreading the instructions
        	                  across many modules. 
     20170424:  MCJ:  Also don't know if the XSLT that is embedded in the DITA needs to be changed. 
    Namespace No namespace
    Match emph[parent::case:judges and ./@typestyle='smcaps']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="emph[parent::case:judges and ./@typestyle='smcaps']">
      <xsl:apply-templates/>
    </xsl:template>
    Template heading/title/emph
    Documentation

    Description

    Instructions [common element]

    heading/title/emph becomes heading/title. That is, the emph start-tag and end-tag (but not the content) are dropped, and the content becomes part of the target parent title element.

    Source XML

    
    <heading>
        <title>
            <emph typestyle="bf">Judgment</emph>
        </title>
    </heading>
    
    	

    Target XML

    
    <heading>
        <title>
    Judgment
        </title>
    </heading>
    
    	

    Source XML: For multiple emph elements

    
    <heading>
      <title>
        <emph typestyle="bf">
          <emph typestyle="bf">
            Doc. 5.27 - Section 10(<emph typestyle="it"><emph typestyle="it">b</emph></emph>) &#x2014; Affidavit
          </emph>
        </emph>
      </title>
    </heading>
                      
           

    Target XML

    
    <heading>
      <title>Doc. 5.27 - Section 10(b) &#x2014; Affidavit</title>
    </heading>
                   
           

    Source XML: Showing an emph that contains a child element

    
    <heading>
        <title>
            <emph typestyle="bf">Non-residential building—(<ci:cite searchtype="LEG-REF" status="invalid">
            <ci:sesslaw>
              <ci:sesslawinfo>
                <ci:sesslawnum num="1994_23a"/>
                <ci:hierpinpoint><ci:hierlev label="schedule" num="8"/></ci:hierpinpoint>
              </ci:sesslawinfo>
              <ci:sesslawref><ci:standardname normpubcode="UK_ACTS"/></ci:sesslawref>
            </ci:sesslaw>
            <ci:content>VATA 1994, Schedule 8, group 5</ci:content></ci:cite>, note 7A)</emph>
        </title>
    </heading>
    
    	

    Target XML

    
    <heading>
        <title>Non-residential building—(<lnci:cite searchtype="LEG-REF" status="invalid">
          <lnci:sesslaw>
            <lnci:sesslawinfo>
              <lnci:sesslawnum num="1994_23a"/>
              <lnci:hierpinpoint><lnci:hierlev label="schedule" num="8"/></lnci:hierpinpoint>
            </lnci:sesslawinfo>
            <lnci:sesslawref><lnci:standardname normpubcode="UK_ACTS"/></lnci:sesslawref>
          </lnci:sesslaw>
          <lnci:content>VATA 1994, Schedule 8, group 5</lnci:content></lnci:cite>, note 7A)</title>
    </heading>
    
    	

    Source XML: When source is having emph and PCDATA under heading/title than in that case the emph element get dropped from target and its content along with the PCDATA will be put directly under title element.

    
    <heading>
         <title>
            <emph typestyle="it">R</emph>(on the application of Green) v Police Complaints Authority
                 <fnr fnrtoken="d30e128" fntoken="d30e1108">13</fnr>
         </title>
    </heading>
    
    	

    Target XML

    
    <heading>
         <title>R (on the application of Green) v Police Complaints Authority
                 <footnote-ref anchoridref="d30e128">
                      <ref:anchor id="d30e1108"/>
                          <label>13</label>
                  </footnote-ref>   
         </title>
    </heading>
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_emp-Chof-heading_title-LxAdv-heading_title.dita"/> 
     MDS - 2017-03-13 - Moved functionality to modules/nonamespace/Rosetta_emph-LxAdv-emph.xsl and removed this module from Driver 
     CSN: Created mail template 
    Namespace No namespace
    Match heading/title/emph
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="heading/title/emph">
      <xsl:apply-templates/>
    </xsl:template>
    Template heading/title/emph/emph
    Namespace No namespace
    Match heading/title/emph/emph
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="heading/title/emph/emph">
      <xsl:apply-templates/>
    </xsl:template>
    Template jrnl:prelim/heading/title
    Documentation

    Description

     HK02-Articles heading handling 
    Namespace No namespace
    Match jrnl:prelim/heading/title
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="jrnl:prelim/heading/title">
      <nitf:hl1>
        <xsl:apply-templates/>
      </nitf:hl1>
    </xsl:template>
    Template refpt[ following-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]] or preceding-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]] or preceding-sibling::node()[1][self::text()[matches(. , '^\s+$')] [preceding-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]]]] or following-sibling::node()[1][self::text()[matches(. , '^\s+$')] [following-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]]]] ]
    Documentation

    Description

    Instructions [common element] Handling of Footnote references and Endnotes

    Whenever refpt and remotelink occurs as adjacent siblings, this indicates they are footnote refernces and are linked to endnotes within the document or outside the document.

  • Check for the remotelink/@refpt value, if it is "*_FN#", then create a footnote-ref. If it is "*_FN#-R" then create the footnote as child of endnotes.
  • The l around endnotes is converted to endnotes the li around a endnote is removed when refpt and remotelink is converted to footnote/@role="endnote".
  • Note: endnote references can be found at any place in the same document or in another document.

    Note: We are only converting refpt and remotelink to footnote/@role="endnote" within primlaw:level/@leveltype="endnote" when they occurs as adjacent siblings.

    Note: footnote-ref/@reftype will be set to "global" if refpt/@id="ext".

    The attribute value's for refpt/@id and remotelink/@refpt are duplicated within the source document i.e.,

  • refpt/@id (footnote refernce) and remotelink/@refpt (endnote) will be same. and
  • remotelink/@refpt (footnote refernces) and refpt/@id (endnote) will be same.
  • Note: The endnote and associated endnote references may be in different documents.

    Footnote-ref: Every occurance of refpt and remotelink will become footnote-ref in output. Populate footnote-ref as follows:

    • footnote-ref/@role will always be set to "endnote".
    • remotelink/@refpt becomes footnote-ref/@anchoridref.
    • refpt/@id becomes footnote-ref/ref:anchor/@id.
    • remotelink/sup becomes footnote-ref/label.
    • remotelink attributes are converted as follows:

      Create footnote:ref/ref:locator/ref:locator-key with attributes and children as follows:

      • If @remotekey1="DOC-ID" then
        • ref:key-name/@name will have the value "DOC-ID".
        • key-value/@value will be the value of @dpsi followed by hyphen and concatenated with @refpt or @remotekey2, which ever is present (if both are present, use @remotekey2).
      • If @remotekey1="REFPTID" then
        • ref:key-name/@name will have the value "DOC-ID".
        • ref:key-value/@value will be the value of @dpsi followed by hyphen and concatenated with @docidref.
        • Create ref:locator/@anchoridref with value from @refpt or @remotekey2, which ever is present (if both are present, use @refpt).

    Endnote: Every occurance of refpt and remotelink will become footnote as a child of endnotes which is the container element for all the converted endnotes. Populate each footnote created within endnotes as follows:

    • footnote/@role will always be set to "endnote".
    • refpt/@id becomes footnote/ref:anchor/@id.
    • remotelink/sup becomes footnote/label.
    • remotelink/sub becomes footnote/label.
    • remotelink attributes are converted as follows:

      Create footnote/ref:returnreference/ref:locator/ref:locator-key with attributes and children as follows:

      • If @remotekey1="DOC-ID" then
        • ref:key-name/@name will have the value "DOC-ID".
        • key-value/@value will be the value of @dpsi followed by hyphen and concatenated with @refpt or @remotekey2, which ever is present (if both are present, use @remotekey2).
      • If @remotekey1="REFPTID" then
        • ref:key-name/@name will have the value "DOC-ID".
        • ref:key-value/@value will be the value of @dpsi followed by hyphen and concatenated with @docidref.
        • Create ref:locator/@anchoridref with value from @refpt or @remotekey2, which ever is present (if both are present, use @refpt).

      Note: If remotelink/@dpsi is not present, use value from docinfo:dpsi/@id-string or capture value from the LBU manifest file.

      Note: ref:locator/@anchoridref that begins with a number must have an underscore added at start. Also apply other identifier data type format as used for xml:id and ref:anchor/@id (e.g. change colon to underscore). Refer to the section titled "Identifiers to ID Data Type - Handling Pattern Restrictions", if that section exists in this CI.

    Note: All elements between the l and the nearest ancestor leg:level are not converted as usual. For example, leg:endmatter/leg:level/leg:level-vrnt/leg:levelbody/leg:bodytext/l/li becomes primlaw:level/endnotes/footnote with appropriate attributes.

    Note: For the Xpath leg:bodytext/glp:note/l/li, all elements between l and the nearest ancestor glp:note are not converted as usual and the target endnote will be sibling of primlaw:bodytext. The target Xpath will be primlaw:level/endnotes/footnote. Refer below source XML 3 and target XML 3.

    Source XML 1

    
    <!--Rosetta AU source markup for a reference to an endnote VIC_ACT_6231.xml-->
        <row>
            <entry colname="c1" align="left">Pt 3 Div. 1 Subdiv. (12) (Heading and ss 390–396)
            </entry>
            <entry colname="c2" align="left">repealed. 
                <emph typestyle="bf"><sup>,</sup></emph>
                
    <!-- Footnote-refernce-start -->
                <refpt id="VIC_ACT_6231_FN32-R" type="ext"/>
                <remotelink remotekey1="REFPTID" service="DOC-ID" dpsi="0062" docidref="ABCD_5641" refpt="VIC_ACT_6231_FN32">
                    <sup>32</sup>
                </remotelink>
    <!-- Footnote-reference-end -->
    
                <emph typestyle="bf"><sup>,</sup></emph>
            </entry>
        </row>
    ...
    <leg:endmatter>
        <leg:level>
            <leg:level-vrnt>
                <leg:levelbody>
                    <leg:bodytext>
    <!--Endnote-start -->
                        <l>
                            <li>
                                <lilabel>
                                    <refpt id="VIC_ACT_6231_FN32" type="ext"/>
                                    <remotelink remotekey1="REFPTID" service="DOC-ID" dpsi="0062" docidref="ABCD_5641" refpt="VIC_ACT_6231_FN32-R"><sup>32</sup></remotelink>
                                </lilabel>
                                <p>
                                    <text align="left">...</text>
                                </p>
                            </li>
                        <!-- ... -->
                        </l>
    <!--Endnote-end -->
                    </leg:bodytext>
                </leg:levelbody>
            </leg:level-vrnt>
        </leg:level>
    </leg:endmatter>
    
    	

    Target XML 1

    
    <!--
    footnote-ref/@role will always be set to "endnote"
    remotelink/@refpt becomes footnote-ref/@anchoridref
    refpt/@id becomes footnote-ref/ref:anchor/@id
    remotelink/sub becomes footnote-ref/label
    -->
        <row>
            <entry colname="c1" align="left">Pt 3 Div. 1 Subdiv. (12) (Heading and ss 390–396)
            </entry>
            <entry colname="c2" align="left">repealed. 
                <emph typestyle="bf"><sup>,</sup></emph>
                
             <!--   Footnote-reference-start --> 
                
                <footnote-ref role="endnote" anchoridref="VIC_ACT_6231_FN32">               	
                   	<ref:anchor id="_0062-VIC_ACT_6231_FN32-R" anchortype="global"/>
                    <ref:locator anchoridref="VIC_ACT_6231_FN32">
                    <ref:locator-key>
                        <ref:key-name name="DOC-ID"/> 
                        <ref:key-value value="0062-ABCD_5641"/>
                    </ref:locator-key>
                </ref:locator>
    
                   	<label>32</label>
               </footnote-ref>
    
               <!-- Footnote-reference-end -->
                
                <emph typestyle="bf"><sup>,</sup></emph>
            </entry>
        </row>
    
    <!--
    ...
    endnotes/footnote/@role will always set to "endnote"
    refpt/@id becomes footnote/ref:anchor/@id
    remotelink/sub becomes footnote/label
    -->
    <!-- Endnote-start-->
    <primlaw:level leveltype="endnote">
        <endnotes>
            <footnote role="endnote">
                <ref:returnreference>
                    <ref:locator anchoridref="VIC_ACT_6231_FN32-R">
                        <ref:locator-key>
                            <ref:key-name name="DOC-ID"/>
                            <ref:key-value value="0062-ABCD_5641"/>
                        </ref:locator-key>
                    </ref:locator>
                </ref:returnreference>
                <ref:anchor id="0062-VIC_ACT_6231_FN32" anchortype="global"/>
                <label>32</label>
                <bodytext>
                    <p>
                        <text align="left">...</text>
                    </p>
                </bodytext>
            </footnote>
            <!-- rest of footnote@role='endnote' -->
        </endnotes>
    </primlaw:level>
    <!--Endnote-end -->
    
    	

    Source XML 2

    
    <!--Rosetta AU source markup for a reference to an endnote VIC_ACT_9595.xml-->
        <!-- Footnote-refernce-start -->
    <title align="left" searchtype="SECT-TITLE">
        <emph typestyle="bf"><emph typestyle="it">Constitution of Board</emph></emph><refpt id="VIC_ACT_9595_FN1-R" type="ext"/><remotelink remotekey1="REFPTID" service="DOC-ID" refpt="VIC_ACT_9595_FN1"><sup>1</sup></remotelink>&#x00A0;
        <lnlink status="valid" service="SEARCH" scope="All Subscribed Australian Cases and Commentary" scope-protocol="combined-source-name">
            <marker><inlineobject width="21px" type="image" filename="mb.gif" attachment="web-server" alttext="click to find cases &amp; commentary"/>
            </marker>
            <api-params>
                <param name="expressSearch" value="true"/><param name="searchString" value="COUNCIL OF ADULT EDUCATION ACT 1981 w/s LEG-REF(6)"/></api-params>
        </lnlink>
    </title>
    <!-- Footnote-reference-end -->
    
    <!-- ... -->
    
    <leg:level id="VIC_ACT_9595_NOTESPROV4">
        <leg:level-vrnt leveltype="clause" searchtype="LEGISLATION" subdoc="true" toc-caption="4. List of Annotations">
            <leg:heading>
                <!-- ... -->
            </leg:heading>
            <leg:levelbody>
              <leg:bodytext>
                 <table>
                    <tgroup cols="2">
                     <colspec colwidth="3*" colname="c1" colnum="1"/>
                     <colspec colwidth="12*" colname="c2" colnum="2"/>
                     <tbody>
                    <row>
                    <entry colname="c1">S. 2 def. of &quot;adult, community and further education&quot;</entry>
                    <entry colname="c2">inserted by No. 91/1991 s. 44(a).</entry>
                   <!--... --> 
                </tbody>
            </tgroup>
        </table>
                   <!--Endnote-start -->
        <l>
            <li><lilabel><refpt id="VIC_ACT_9595_FN1" type="ext"/><remotelink remotekey1="REFPTID" service="DOC-ID" refpt="VIC_ACT_9595_FN1-R"><sup>1</sup></remotelink></lilabel>
                <p><text align="left">S. 6: Section&#x00A0;50 of the <emph typestyle="bf">Adult, Community and Further Education Act 1991</emph>, No. 91/1991, provides as follows:</text></p>
                <p><text align="left"><emph typestyle="bf">'50. <emph typestyle="it">Transitional provisions for the Council of Adult Education</emph></emph></text></p>
            </li>
            <!-- ... -->
        </l>
                <!--Endnote-end -->   
               </leg:bodytext>
            </leg:levelbody>
        </leg:level-vrnt>
    </leg:level>
    
    	

    Target XML 2

    
    <!--
    footnote-ref/@role will always be set to "endnote"
    remotelink/@refpt becomes footnote-ref/@anchoridref
    refpt/@id becomes footnote-ref/ref:anchor/@id
    remotelink/sub becomes footnote-ref/label
    -->
       <!--   Footnote-reference-start --> 
                
                <title align="left">
        <emph typestyle="bf"><emph typestyle="it">Constitution of Board</emph></emph>
        <footnote-ref role="endnote" anchoridref="VIC_ACT_9595_FN1">               	
            <ref:anchor id="VIC_ACT_9595_FN1-R" anchortype="global"/>
            <ref:locator anchoridref="VIC_ACT_9595_FN1">
                <ref:locator-key>
                    <ref:key-name name="DOC-ID"/> 
                    <ref:key-value value="0062-ABCD_1234"/>
                </ref:locator-key>
            </ref:locator>        
            <label>1</label>
        </footnote-ref>&#x00A0;    
    </title>
    
         <!-- Footnote-reference-end -->           
               
    <!--
    ...
    endnotes/footnote/@role will always set to "endnote"
    refpt/@id becomes footnote/ref:anchor/@id
    remotelink/sub becomes footnote/label
    -->
    <primlaw:level xml:id="VIC_ACT_9595_NOTESPROV4" leveltype="clause" includeintoc="true" alternatetoccaption="4. List of Annotations">    
            <heading>
                <!-- ... -->
            </heading>
            <primlaw:bodytext>
                <table>
                    <tgroup cols="2">
                        <colspec colwidth="3*" colname="c1" colnum="1"/>
                        <colspec colwidth="12*" colname="c2" colnum="2"/>
                        <tbody>
                            <row><entry colname="c1">S. 2 def. of &quot;adult, community and further education&quot;</entry><entry colname="c2">inserted by No. 91/1991 s. 44(a).</entry>
                                <!--... --> 
                        </tbody>
                    </tgroup>
                </table>
            </primlaw:bodytext>
        <!-- Endnote-start-->
        <endnotes>
            <footnote role="endnote">
                <ref:returnreference>
                    <ref:locator anchoridref="VIC_ACT_9595_FN1-R"/>	
                    <ref:locator-key>
                        <ref:key-name name="DOC-ID"/> 
                        <ref:key-value value="0062-ABCD_1234"/>
                    </ref:locator-key>
                    </ref:locator>
                </ref:returnreference>
                <ref:anchor id="0062-VIC_ACT_9595_FN1" anchortype="global"/>
                <label>1</label>
                <bodytext>
                    <p><text align="left">S. 6: Section&#x00A0;50 of the <emph typestyle="bf">Adult, Community and Further Education Act 1991</emph>, No. 91/1991, provides as follows:</text></p>
                    <p><text align="left"><emph typestyle="bf">'50. <emph typestyle="it">Transitional provisions for the Council of Adult Education</emph></emph></text></p>
                </bodytext>
            </footnote>
            <!--rest of footnote@role=”endnote” -->
        </endnotes>
        <!--Endnote-end -->
    </primlaw:level>
    
    	

    Source XML 3

    
    <!--Rosetta AU source markup for a reference to an endnote AUS-0065-20130614133539_VIC_REG_2012-14210020.xml-->
       <leg:level id="VIC_REG_2012-142_PROV4">
        - <leg:level-vrnt searchtype="LEGISLATION" subdoc="true" leveltype="reg" toc-caption="4 Principal Rules">
            - <leg:heading>
                - <desig searchtype="REG-NUM">
                    - <designum>
                        <refpt id="VIC_REG_2012-142_PROV4" type="ext" /> 
                        <emph typestyle="bf">4</emph> 
                    </designum>
                </desig>
                - <title align="left" searchtype="REG-TITLE">
                    <emph typestyle="bf">Principal Rules</emph> 
                </title>
            </leg:heading>
            - <leg:levelbody>
                - <leg:bodytext>
                    - <p>
                        - <text align="left">
                            In these Rules, the Supreme Court (General Civil Procedure) Rules 2005
                            
                            <!-- Footnote-refernce-start -->
                            <refpt id="VIC_REG_2012-142_FN1-R" type="ext" /> 
                            - <remotelink remotekey1="REFPTID" service="DOC-ID" refpt="VIC_REG_2012-142_FN1" docidref="VIC_REG_2012-142_BODY">
                                <sup>1</sup> 
                            </remotelink>
                            
                            <!-- Footnote-refernce-end -->
                            are called the Principal Rules. 
                        </text>
                    </p>
                    - <glp:note>
                        <!--Endnote-start -->
                        - <l>
                            - <li>
                                - <lilabel>
                                    <refpt id="VIC_REG_2012-142_FN1" type="ext" /> 
                                    - <remotelink remotekey1="REFPTID" service="DOC-ID" refpt="VIC_REG_2012-142_FN1-R" docidref="VIC_REG_2012-142_BODY">
                                        <sup>1</sup> 
                                    </remotelink>
                                </lilabel>
                                - <p>
                                    <text align="left">Rule 4: S.R. No. 148/2005. Reprint No. 4 as at 17 September 2012. Reprinted to S.R. No. 97/2012 and subsequently amended by S.R. Nos 39/2012 and 121/2012.</text> 
                                </p>
                            </li>
                        </l>
                        <!--Endnote-end -->
                    </glp:note>
                </leg:bodytext>
            </leg:levelbody>
        </leg:level-vrnt>
    </leg:level>
    
    	

    Target XML 3

    
    <!--
    footnote-ref/@role will always be set to "endnote"
    remotelink/@refpt becomes footnote-ref/@anchoridref
    refpt/@id becomes footnote-ref/ref:anchor/@id
    remotelink/sub becomes footnote-ref/label
    -->
       <primlaw:level includeintoc="true" alternatetoccaption="4 Principal Rules"
        leveltype="regulation">
        <ref:anchor id="VIC_REG_2012-142_PROV4" anchortype="global"/>
        <heading>
            <desig>
                <emph typestyle="bf">4</emph>
            </desig>
            <title align="left">
                <emph typestyle="bf">Principal Rules</emph>
            </title>
        </heading>
        <primlaw:bodytext>
            <p align="left">
                <text>In these Rules, the Supreme Court (General Civil Procedure) Rules
                    2005
                    <!-- Footnote-refernce-start -->
                    <footnote-ref anchoridref="VIC_REG_2012-142_FN1" role="endnote">
                        <ref:anchor id="VIC_REG_2012-142_FN1-R"/>
                        <ref:locator anchoridref="VIC_REG_2012-142_FN1">
                            <ref:locator-key><ref:key-name name="DOC-ID"/>
                                <ref:key-value value="0065-VIC_REG_2012-142_BODY"
                                />
                            </ref:locator-key>
                        </ref:locator>
                        <label>1</label>
                    </footnote-ref>
                     <!-- Footnote-refernce-end -->
                    are called the Principal Rules.</text>
            </p>
        </primlaw:bodytext>
        <!-- Endnote-start-->
        <endnotes>
            <footnote role="endnote">
                <ref:returnreference>
                    <ref:locator anchoridref="VIC_REG_2012142_FN1R"/>
                    <ref:locator-key>
                        <ref:key-name name="DOC-ID"/>
                        <ref:key-value value="0065-VIC_REG_2012142_BODY"/>
                    </ref:locator-key>
                    </ref:locator>
                </ref:returnreference>
                <ref:anchor id="0065-VIC_REG_2012142_FN1" anchortype="global"/>
                <label>1</label> 
                <bodytext>
                    <p>
                        <text align="left">Rule 4: S.R. No. 148/2005. Reprint No. 4 as at 17 September 2012. Reprinted to S.R. No. 97/2012 and subsequently amended by S.R. Nos 39/2012 and 121/2012.</text> 
                    </p>
                </bodytext>
            </footnote> 
        </endnotes>
        <!-- Endnote-end-->
    </primlaw:level>
    
    	

    Description

     end topichead  emph  
     rosetta element: endnote 
     <topicref href="../../common_newest/Rosetta_endnote-LxAdv-endnote.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_endnote-LxAdv-endnote.dita  
     JL 20171109: white-space proofed the test, with fallback to traditional remotelink processing.
        Also tightened up the criteria for refpt and remotelink matching to include the @refpt FN string,
        so the processing for refpt or remotelink will resort to default handling if all the criteria are not met.
        This fixes a few production webstars 
        
    Namespace No namespace
    Match refpt[ following-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]] or preceding-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]] or preceding-sibling::node()[1][self::text()[matches(. , '^\s+$')] [preceding-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]]]] or following-sibling::node()[1][self::text()[matches(. , '^\s+$')] [following-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]]]] ]
    Mode #default
    Import precedence 0
    Priority 30
    Source
    <xsl:template match="refpt[         following-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]]         or          preceding-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]]         or          preceding-sibling::node()[1][self::text()[matches(. , '^\s+$')]         [preceding-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]]]]         or          following-sibling::node()[1][self::text()[matches(. , '^\s+$')]         [following-sibling::node()[1][self::remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]]]]                 ]" priority="30">
      <!-- do nothing -->
    </xsl:template>
    Template remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')] [preceding-sibling::node()[1][self::refpt] or following-sibling::node()[1][self::refpt] or preceding-sibling::node()[1][self::text()[matches(. , '^\s+$')][preceding-sibling::node()[1][self::refpt]]] or following-sibling::node()[1][self::text()[matches(. , '^\s+$')][following-sibling::node()[1][self::refpt]]] ]
    Documentation

    Description

     note: this logic will need to be merged with "remotelink" 
                    
                    JL made it node rather than element because there can be intervening text, and we don't want to do
                    this with intervening text.
    Namespace No namespace
    Match remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')] [preceding-sibling::node()[1][self::refpt] or following-sibling::node()[1][self::refpt] or preceding-sibling::node()[1][self::text()[matches(. , '^\s+$')][preceding-sibling::node()[1][self::refpt]]] or following-sibling::node()[1][self::text()[matches(. , '^\s+$')][following-sibling::node()[1][self::refpt]]] ]
    Mode #default
    References
    Import precedence 0
    Priority 30
    Source
    <xsl:template match="remotelink[matches(@refpt , '^.*FN(\d+)\-R$') or matches(@refpt , '^.*FN(\d+)$')]         [preceding-sibling::node()[1][self::refpt]         or         following-sibling::node()[1][self::refpt]         or         preceding-sibling::node()[1][self::text()[matches(. , '^\s+$')][preceding-sibling::node()[1][self::refpt]]]         or         following-sibling::node()[1][self::text()[matches(. , '^\s+$')][following-sibling::node()[1][self::refpt]]]        ]" priority="30">
      <xsl:choose>
        <xsl:when test="matches(@refpt , '^.*FN(\d+)\-R$')">
          <xsl:apply-templates select="." mode="endnote"/>
        </xsl:when>
        <xsl:when test="matches(@refpt , '^.*FN(\d+)$')">
          <xsl:apply-templates select="." mode="footnoteref"/>
        </xsl:when>
        <xsl:otherwise>
          <!-- this should now never happen -->
          <xsl:call-template name="outputErrorMessage">
            <xsl:with-param name="messageText" as="xs:string" select=" 'remotelink/@refpt does not meet criteria for endnote or footnoteref' "/>
            <xsl:with-param name="errorType" as="xs:string" select=" 'ICCE' "/>
            <xsl:with-param name="errorCode" as="xs:string*" select=" 'TBD' "/>
            <xsl:with-param name="context" as="xs:string">
              <xsl:value-of select="base-uri()"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template remotelinkfootnoteref
    Namespace No namespace
    Match remotelink
    Mode footnoteref
    References
    Import precedence 0
    Source
    <xsl:template match="remotelink" mode="footnoteref">
      <footnote-ref>
        <xsl:attribute name="role" select="'endnote'"/>
        <xsl:attribute name="anchoridref">
          <xsl:for-each select="@refpt">
            <xsl:call-template name="normalizeIdString"/>
          </xsl:for-each>
        </xsl:attribute>
        <xsl:for-each select="preceding-sibling::node()[1][self::refpt] | following-sibling::node()[1][self::refpt]">
          <xsl:call-template name="refpt-generic"/>
        </xsl:for-each>
        <xsl:call-template name="locator"/>
        <xsl:apply-templates select="sup" mode="footnoteref"/>
      </footnote-ref>
    </xsl:template>
    Template locator
    Namespace No namespace
    Used by
    References
    Import precedence 0
    Source
    <xsl:template name="locator">
      <ref:locator>
        <xsl:for-each select=" if (@refpt) then @refpt else @remotekey2">
          <xsl:attribute name="anchoridref">
            <xsl:call-template name="normalizeIdString"/>
          </xsl:attribute>
        </xsl:for-each>
        <ref:locator-key>
          <ref:key-name name="DOC-ID"/>
          <ref:key-value>
            <xsl:attribute name="value">
              <xsl:choose>
                <xsl:when test="@dpsi">
                  <xsl:value-of select="@dpsi"/>
                </xsl:when>
                <xsl:when test="//docinfo:dpsi/@id-string">
                  <xsl:value-of select="//docinfo:dpsi/@id-string"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$dpsi"/>
                </xsl:otherwise>
              </xsl:choose>
              <xsl:text>-</xsl:text>
              <xsl:choose>
                <xsl:when test=" @remotekey1 = 'DOC-ID' or @remotekey1 = 'DOCID' ">
                  <xsl:value-of select="if (@remotekey2) then @remotekey2 else @refpt"/>
                </xsl:when>
                <xsl:when test=" @remotekey1 = 'REFPTID' or @remotekey1 = 'REFPT' ">
                  <xsl:choose>
                    <xsl:when test="@docidref">
                      <xsl:value-of select="@docidref"/>
                    </xsl:when>
                    <xsl:when test="@status=('unval','invalid')">
                      <!-- no @docidref however status is unvalidated or invalid so don't throw error  -->
                    </xsl:when>
                    <xsl:otherwise>
                      <!-- This should be an error message -->
                      <xsl:text>XXXX</xsl:text>
                      <xsl:call-template name="outputErrorMessage">
                        <xsl:with-param name="messageText" as="xs:string" select=" 'remotelink/@docidref is missing and link cannot be correctly completed' "/>
                        <xsl:with-param name="errorType" as="xs:string" select=" 'ICCE' "/>
                        <xsl:with-param name="errorCode" as="xs:string*" select=" '403' "/>
                        <xsl:with-param name="context" as="xs:string">
                          <xsl:value-of select="base-uri()"/>
                        </xsl:with-param>
                      </xsl:call-template>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:when>
              </xsl:choose>
            </xsl:attribute>
          </ref:key-value>
        </ref:locator-key>
      </ref:locator>
    </xsl:template>
    Template remotelinkendnote
    Namespace No namespace
    Match remotelink
    Mode endnote
    References
    Templates
    Import precedence 0
    Source
    <xsl:template match="remotelink" mode="endnote">
      <footnote>
        <xsl:attribute name="role" select="'endnote'"/>
        <!-- Paul: moved the refanchor creation (foreach) before the ref:returnreference.
                The court rules schema (and statutory) requires this occur first.  -->
        <xsl:for-each select="preceding-sibling::refpt | following-sibling::refpt">
          <xsl:call-template name="refpt-generic"/>
        </xsl:for-each>
        <ref:returnreference>
          <xsl:call-template name="locator"/>
        </ref:returnreference>
        <xsl:apply-templates select="sup | sub" mode="footnoteref"/>
        <xsl:if test="parent::lilabel[following-sibling::node()]">
          <bodytext>
            <xsl:apply-templates select="parent::lilabel/following-sibling::node()"/>
          </bodytext>
        </xsl:if>
      </footnote>
    </xsl:template>
    Template sup | subfootnoteref
    Namespace No namespace
    Match sup | sub
    Mode footnoteref
    Import precedence 0
    Source
    <xsl:template match="sup | sub" mode="footnoteref">
      <label>
        <xsl:apply-templates/>
      </label>
    </xsl:template>
    Template l[li[lilabel[refpt][remotelink][not(child::*[3])]]][not(child::*[not(self::li[lilabel[refpt][remotelink][not(child::*[3])]])])][not(@virtual-nesting)]
    Namespace No namespace
    Match l[li[lilabel[refpt][remotelink][not(child::*[3])]]][not(child::*[not(self::li[lilabel[refpt][remotelink][not(child::*[3])]])])][not(@virtual-nesting)]
    Mode #default
    Import precedence 0
    Priority 30
    Source
    <xsl:template match="l[li[lilabel[refpt][remotelink][not(child::*[3])]]][not(child::*[not(self::li[lilabel[refpt][remotelink][not(child::*[3])]])])][not(@virtual-nesting)]" priority="30">
      <endnotes>
        <xsl:apply-templates select="li" mode="endnote"/>
      </endnotes>
    </xsl:template>
    Template liendnote
    Namespace No namespace
    Match li
    Mode endnote
    Import precedence 0
    Source
    <xsl:template match="li" mode="endnote">
      <xsl:apply-templates select="lilabel" mode="endnote"/>
    </xsl:template>
    Template lilabelendnote
    Namespace No namespace
    Match lilabel
    Mode endnote
    Import precedence 0
    Source
    <xsl:template match="lilabel" mode="endnote">
      <xsl:apply-templates select="remotelink" mode="endnote"/>
    </xsl:template>
    Template leg:bodytext
    Documentation

    Description

     endnotes become a bump-up within primlaw:level (within and outside of glp:note) as well as leg:comntry
       Since I coded this for a dictionary stream, it hasn't been tested yet.  Someone with a 
       legislation stream should test it and sign off here. JL 
       
       JD: 2017-08-10: works for legislation stream NZ06; see notes in /modules/glp/Rosetta_glp.note-LxAdv-note.xsl
       
    Namespace No namespace
    Match leg:bodytext
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 30
    Source
    <xsl:template match="leg:bodytext" priority="30">
      <!-- this will handle annotations interspersed with primlaw:bodytext elements in document order -->
      <xsl:for-each-group select="*" group-adjacent="if (self::leg:comntry or self::l[li[lilabel[refpt][remotelink][not(child::*[3])]]][not(child::*[not(self::li[lilabel[refpt][remotelink][not(child::*[3])]])])][not(@virtual-nesting)]              or self::glp:note[l[li[lilabel[refpt][remotelink][not(child::*[3])]]][not(child::*[not(self::li[lilabel[refpt][remotelink][not(child::*[3])]])])][not(@virtual-nesting)]]             ) then 0 else 1">
        <xsl:choose>
          <xsl:when test="current-grouping-key()=0">
            <xsl:for-each select="current-group()">
              <xsl:choose>
                <xsl:when test="self::glp:note">
                  <xsl:apply-templates select="*"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:apply-templates select="."/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:for-each>
          </xsl:when>
          <xsl:otherwise>
            <xsl:choose>
              <xsl:when test="$streamID='AU19LA' or ($streamID=('NZ12') and not(ancestor::legfragment))">
                <admindoc:bodytext>
                  <xsl:apply-templates select="parent::leg:bodytext/@*"/>
                  <xsl:for-each select="current-group()">
                    <xsl:apply-templates select="."/>
                  </xsl:for-each>
                </admindoc:bodytext>
              </xsl:when>
              <xsl:when test="$streamID='AU18' and not(ancestor::legfragment)">
                <xsl:choose>
                  <xsl:when test="parent::leg:bodytext[preceding-sibling::leg:level]">
                    <xsl:element name="admindoc:level">
                      <xsl:attribute name="leveltype">
                        <xsl:text>unclassified</xsl:text>
                      </xsl:attribute>
                      <admindoc:bodytext>
                        <xsl:apply-templates select="parent::leg:bodytext/@*"/>
                        <xsl:for-each select="current-group()">
                          <xsl:apply-templates select="."/>
                        </xsl:for-each>
                      </admindoc:bodytext>
                    </xsl:element>
                  </xsl:when>
                  <xsl:otherwise>
                    <admindoc:bodytext>
                      <xsl:apply-templates select="parent::leg:bodytext/@*"/>
                      <xsl:for-each select="current-group()">
                        <xsl:apply-templates select="."/>
                      </xsl:for-each>
                    </admindoc:bodytext>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
              <xsl:otherwise>
                <primlaw:bodytext>
                  <xsl:apply-templates select="parent::leg:bodytext/@*"/>
                  <xsl:for-each select="current-group()">
                    <xsl:apply-templates select="."/>
                  </xsl:for-each>
                </primlaw:bodytext>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each-group>
    </xsl:template>
    Template leg:bodytext/@searchtype[$streamID='UK06']
    Documentation

    Description

     This template is being suppressed as no requirement in the output. 
    Namespace No namespace
    Match leg:bodytext/@searchtype[$streamID='UK06']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="leg:bodytext/@searchtype[$streamID='UK06']"/>
    Template figure
    Documentation

    Description

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    figure becomes figure. The children of figure are handled as follows:

    Note: In NewLexis figure is not allowed within blockquote element. If figure element is a direct child of blockquote element and figure element does not have any sibling element in blockquote element, then drop the outer blockquote element in NewLexis.

    Note:

    figure/glp:note/h becomes figure/note/bodytext/h in NewLexis.

    If figure/p becomes figure/note/bodytext/p in NL conversion.

    Example 1

    <blockquote>
        <figure>
            <glp:note>
                <h>(MAB PROGRAMME STRUCTURE)</h>
            </glp:note>
            <inlineobject type="image" attachment="ln-server" filename="pbep-g00121.gif"/>
        </figure>
    </blockquote>
                
    becomes
                        
    <figure>
        <note>
            <bodytext>
                <h>(MAB PROGRAMME STRUCTURE)</h>
            </bodytext>
        </note>
        <ref:inlineobject>
            <ref:locator>
                <ref:locator-key>
                        <ref:key-name name="object-key"/>
                        <ref:key-value value="X-Y-pbep-g00121"/>    <!-- X and Y are LNI and SMI values obtained from CSSM -->
                </ref:locator-key>
                <ref:locator-params>
                    <proc:param name="componentseq" value="1"/>
                    <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                    <proc:param name="object-smi" value=""/>    <!-- This @value assignment is done by conversion program -->
                </ref:locator-params>
            </ref:locator>
        </ref:inlineobject>
    </figure>
                

    Example 2

    <figure>
        <inlineobject filename="1484985_RSOS_913_CURRENT-0001.jpg" type="image" attachment="ln-server"/>
    </figure>
    
                
    becomes
                        
    <figure>                   
        <ref:inlineobject>
            <ref:locator>
                <ref:locator-key>
                    <ref:key-name name="object-key"/>
                    <ref:key-value value="X-Y-1484985-RSOS-913-CURRENT-0001"/>  <!-- X and Y are LNI and SMI values obtained from CSSM -->
                </ref:locator-key>
                <ref:locator-params>
                    <proc:param name="componentseq" value="1"/>
                    <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png)-->
                    <proc:param name="object-smi" value=""/>    <!-- This @value assignment is done by conversion program -->
                </ref:locator-params>
            </ref:locator>
        </ref:inlineobject>
    </figure>
                

    Example 3

    <figure>
        <caption>Head of PSL IP&amp;IT</caption>
        <inlineobject filename="Lawrence Milner.jpg"/>
    </figure>
                
    becomes
                        
    <figure>
        <caption>
            <p>
                <text>Head of PSL IP&amp;IT</text>
            </p>
        </caption>
        <ref:inlineobject>
            <ref:locator>
                <ref:locator-key>
                    <ref:key-name name="object-key"/>
                    <ref:key-value value="X-Y-Lawrence Milner"/>
                    <!-- X and Y are LNI and SMI values obtained from CSSM -->
                </ref:locator-key>
                <ref:locator-params>
                    <proc:param name="componentseq" value="1"/>
                    <proc:param name="object-type" value="image"/>
                    <proc:param name="object-smi" value=""/>
                    <!-- This @value assignment is done by conversion program -->
                </ref:locator-params>
            </ref:locator>
        </ref:inlineobject>
    </figure>
                

    Note: figure/p/text/inlineobject becomes figure/ref:inlineobject, omit p/text from output if figure/p/text/ having only inlineobject as single child and no PCDATA within text.

    Example 4

    
    <figure>
       <p>
           <text>
                   <inlineobject type="image" filename="eu-tracker_band_of_flags.jpg"/>
           </text>
       </p>
    </figure>
    
                
    becomes
                        
    
    <figure>
        <ref:inlineobject>
            <ref:locator>
                <ref:locator-key>
                    <ref:key-name name="object-key"/>
                    <ref:key-value value="X-Y-eu-tracker_band_of_flags"/>
                    <!-- X and Y are LNI and SMI values obtained from CSSM -->
                </ref:locator-key>
                <ref:locator-params>
                    <proc:param name="componentseq" value="1"/>
                    <proc:param name="object-type" value="image"/>
                    <proc:param name="object-smi" value=""/>
                    <!-- This @value assignment is done by conversion program -->
                </ref:locator-params>
            </ref:locator>
        </ref:inlineobject>
    </figure>
    
                

    Example 5. child link

    
    <figure>
        <link type="image" filename="HSWT-THS-W11037A.tif">Click here to view image</link>
    </figure>
    
    
                
    becomes
                        
    
    <figure>
       <ref:lnlink service="ATTACHMENT">
          <ref:marker role="label">Click here to view image</ref:marker>
          <ref:locator>
             <ref:locator-key>
                <ref:key-name name="attachment-key"/>
                <ref:key-value value="X-Y-HSWT-THS-W11037A"/>
                <!-- X and Y are LNI and SMI values obtained from CSSM -->
             </ref:locator-key>
             <ref:locator-params>
                <proc:param name="componentseq" value="1"/>
                <proc:param name="attachment-type" value="image"/>
                <proc:param name="attachment-smi" value=""/>
                <!-- @value populated with SMI obtained from CSSM -->
             </ref:locator-params>
          </ref:locator>
       </ref:lnlink>
    </figure>
    
                

    Description

     start topichead  figure  
     <topicref href="../../common_newest/Rosetta_figure-LxAdv-figure.dita"/> 
    Namespace No namespace
    Match figure
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="figure">
      <xsl:choose>
        <xsl:when test="$streamID='UK06'">
          <xsl:choose>
            <xsl:when test="p/text[not(child::node() except inlineobject)]">
              <xsl:element name="figure">
                <xsl:apply-templates select="p/text/inlineobject | (node() except p[text[not(child::node() except inlineobject)]])"/>
              </xsl:element>
            </xsl:when>
            <xsl:otherwise>
              <xsl:element name="figure">
                <xsl:apply-templates select="@*|node()"/>
              </xsl:element>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:when test="$streamID='AU15'">
          <figure>
            <xsl:apply-templates select="node()"/>
          </figure>
        </xsl:when>
        <xsl:otherwise>
          <xsl:element name="figure">
            <xsl:apply-templates/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template caption[not(preceding-sibling::*[1][self::caption])]
    Namespace No namespace
    Match caption[not(preceding-sibling::*[1][self::caption])]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="caption[not(preceding-sibling::*[1][self::caption])]">
      <xsl:element name="caption">
        <xsl:element name="p">
          <xsl:element name="text">
            <xsl:apply-templates/>
          </xsl:element>
        </xsl:element>
        <xsl:apply-templates select="following-sibling::*[1][self::caption]" mode="caption_wrapper"/>
        <!-- JD: 2017-11-13: apply 'caption_wrapper' mode for follwing p elements that do not contain links/inlineobjects (Note: not limited to first sibling p). Limited to UK08OR for now. -->
        <xsl:apply-templates select="following-sibling::*[self::p[not(text/link or text/inlineobject)]][$streamID='UK08OR']" mode="caption_wrapper"/>
      </xsl:element>
    </xsl:template>
    Template caption[preceding-sibling::*[1][self::caption]]caption_wrapper
    Namespace No namespace
    Match caption[preceding-sibling::*[1][self::caption]]
    Mode caption_wrapper
    Import precedence 0
    Source
    <xsl:template match="caption[preceding-sibling::*[1][self::caption]]" mode="caption_wrapper">
      <xsl:element name="p">
        <xsl:element name="text">
          <xsl:apply-templates/>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template p[not(text/inlineobject) or not(text/link)][preceding-sibling::*[self::caption]][$streamID='UK08OR']caption_wrapper
    Documentation

    Description

     JD: 2017-11-13: new mode 'caption_wrapper' for p siblings of caption that do not contain link or inlineobject (Note: not limited to first sibling p).  Limited to UK08OR for now.  
    Namespace No namespace
    Match p[not(text/inlineobject) or not(text/link)][preceding-sibling::*[self::caption]][$streamID='UK08OR']
    Mode caption_wrapper
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="p[not(text/inlineobject) or not(text/link)][preceding-sibling::*[self::caption]][$streamID='UK08OR']" mode="caption_wrapper">
      <xsl:element name="p">
        <xsl:element name="text">
          <xsl:apply-templates/>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template caption[preceding-sibling::*[1][self::caption]]
    Namespace No namespace
    Match caption[preceding-sibling::*[1][self::caption]]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="caption[preceding-sibling::*[1][self::caption]]"/>
    Template figure/p[preceding-sibling::*[self::caption]][not(text/inlineobject or text/link)][$streamID='UK08OR']
    Documentation

    Description

     JD: 2017-11-13: suppress p when contents have been processed by mode 'caption_wrapper' for p siblings of caption that do not contain link or inlineobject (Note: not limited to first sibling p).  Limited to UK08OR for now.  
    Namespace No namespace
    Match figure/p[preceding-sibling::*[self::caption]][not(text/inlineobject or text/link)][$streamID='UK08OR']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 21
    Source
    <xsl:template match="figure/p[preceding-sibling::*[self::caption]][not(text/inlineobject or text/link)][$streamID='UK08OR']" priority="21"/>
    Template figure/p
    Namespace No namespace
    Match figure/p
    Mode #default
    Import precedence 0
    Priority 20
    Source
    <xsl:template match="figure/p" priority="20">
      <xsl:for-each-group select="*" group-adjacent="if (self::heading or self::inlineobject or self::link           or self::text[not(child::*[not(self::heading or self::inlineobject or self::link)])]) then 0 else 1">
        <xsl:variable name="pVariable">
          <xsl:copy-of select="."/>
        </xsl:variable>
        <xsl:choose>
          <xsl:when test="current-grouping-key()=1">
            <note>
              <bodytext>
                <p>
                  <xsl:apply-templates select="$pVariable/p/@*"/>
                  <xsl:apply-templates select="current-group()"/>
                </p>
              </bodytext>
            </note>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="current-group()"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each-group>
    </xsl:template>
    Template figure/p/text
    Namespace No namespace
    Match figure/p/text
    Mode #default
    Import precedence 0
    Priority 20
    Source
    <xsl:template match="figure/p/text" priority="20">
      <xsl:choose>
        <xsl:when test="parent::p[child::*[not(self::heading or self::inlineobject or self::link or                      self::text[not(child::*[not(self::heading or self::inlineobject or self::link)])])]]">
          <text>
            <xsl:apply-templates select="@* | node()"/>
          </text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template figure[child::p[child::text[child::inlineobject]]][$streamID='CA01' or $streamID='CA15']
    Documentation

    Description

     Vikas Rohilla : Updated for the streamID CA01   
    Namespace No namespace
    Match figure[child::p[child::text[child::inlineobject]]][$streamID='CA01' or $streamID='CA15']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="figure[child::p[child::text[child::inlineobject]]][$streamID='CA01' or $streamID='CA15']">
      <xsl:apply-templates select="descendant::inlineobject"/>
    </xsl:template>
    Template glp:note[$streamID='UK08OR']
    Documentation

    Description

     JD: 2017-11-27: updated for Web* 7054824.
      Limiting to certain streams for now, but may be more broadly applicable.  UK08 only mentions glp:note/h in this file (id-CCCC-10320), but glp:note has no handling.  Inferring from CI example.
      
    Namespace No namespace
    Match glp:note[$streamID='UK08OR']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="glp:note[$streamID='UK08OR']">
      <note>
        <bodytext>
          <xsl:apply-templates/>
        </bodytext>
      </note>
    </xsl:template>
    Template footnotegrp
    Documentation

    Description

    Instructions [common element]

    The source document has footnote references, footnotegrps and footnotes. In the NL schema, footnote references, footnotegroup and footnotes are tagged at the same location where they appear in the source document.

    The footnote markup for NL schema as described below:

    • The footnotegrp/footnote becomes footnotegroup/footnote

      The footnotegrp/heading becomes footnotegroup/heading.

      If footnotegrp is the child of bodytext, then it becomes bodytext/p/text/footnotegroup.

      If footnotegrp is the child of leg:bodytext, then it becomes primlaw:bodytext/p/text/footnotegroup.

      If footnotegrp is a child of level/bodytext, level/bodytext mapped with seclaw:level/seclaw:bodytext and primlaw:level/primlaw:bodytext in different content model. Then follow below listed instructions:

      • Regulation: primlaw:level/primlaw:bodytext/p/text/footnotegroup.
      • Commentary, Form, Precedents and Textbooks: seclaw:level/seclaw:bodytext/p/text/footnotegroup and form:form/form:document/form:bodytext/form:p/form:text/footnotegroup.

      If footnotegrp is a child of case:judgments, then it becomes courtcase:opinions/footnotegroup.

      If footnotegrp is a child of case:judgmentbody, then it becomes courtcase:opinion/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of case:headnote, then it becomes courtcase:head/footnotegroup.

      If footnotegrp is a child of case:decisionsummary, then it becomes casesum:decisionsummary/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of case:factsummary, then it becomes casesum:editorialsummary/p/text/footnotegroup.

      If footnotegrp is a child of case:references, then it becomes ref:relatedrefs/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of case:typeofcase, then it becomes casesum:overview/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of p, then it becomes p/text/footnotegroup.

      If footnotegrp is a child of glp:note, then it becomes note/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of blockquote, then it becomes blockquote/p/text/footnotegroup.

      If footnotegrp is a child of li, then it becomes listitem/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of pgrp, then it becomes pgrp/p/text/footnotegroup.

      If footnotegrp is a child of case:appendix, then it becomes appendix/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of case:consideredcases, then it becomes ref:relatedrefs/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of case:priorhist, then it becomes casehist:summary/p/text/footnotegroup.

      If footnotegrp is a child of note, then it becomes note/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of prelim, then it becomes courtcase:prelim/bodytext/p/text/footnotegroup.

      If footnotegrp is a child of catchwordgrp, then it becomes classify:classification classify:classitem/classify:classitem-identifier/classify:classname/footnotegroup.

      If footnotegrp is a child of sigblock, then it becomes sigblock/p/text/footnotegroup.

      If footnotegrp is a child of frm:body, then it becomes form:document/form:bodytext/form:p/form:text/footnotegroup.

      If footnotegrp is a child of clause, then it becomes form:clause/form:bodytext/form:p/form:text/footnotegroup.

      If footnotegrp is a child of frm:div, then it becomes form:div/form:bodytext/form:p/form:text/footnotegroup.

    • Create footnote/ref:anchor with @id and set footnote/ref:anchor[@id] to the value of footnote[@fntoken].

      Note: ref:anchor[@id] that begins with a number must have an underscore added at start.

      Note:

      This note is applicable only to UK footnotes with a value of "0" in footnote/@fntoken (all content types within UK): For every footnote[@fntoken="0"], a unique value should be placed in the target ref:anchor/@id. Numeric values in ref:anchor/@id must be prepended with "_". Any unique values are acceptable inside ref:anchor/@id, but the simplest solution is to start with <ref:anchor id="_1"/> for the first footnote encountered and increment the value by 1 for each subsequent footnote (e.g. <ref:anchor id="_1"/>, <ref:anchor id="_2"/>, <ref:anchor id="_3"/>, etc.)

      If the value of ref:anchor/@id is not "0", then it should be carried through to ref:anchor/@id as is.

    • Drop attribute @fnrtokens and @fntoken from the footnote element, but note as described above that the source footnote[@fntoken] value is moved to the target footnote/ref:anchor[@id]
    • Create ref:returnreference/reflocator.
      • @anchoridref is set to the id value of the first reference to this footnote. For example, footnote/ref:anchor[@id="_1"], will use the value from((//footnote-ref[@anchoridref="_1"])[1])/ref:anchor/@id.

        Note: If the return reference ID cannot be located, it is not necessary to create the ref:returnreference.

      • @anchortype is set to "local"
    • footnote/fnlabel becomes footnote/label.
    • footnote/fnbody becomes footnote/bodytext.
      • Special Canada rule to suppress indent: footnote/fnbody/p[@indent] becomes footnote/bodytext/p. That is, suppress @indent for all Canada streams. (Note that attribute p[@i] is also suppressed, as per General Markup rules for p).
    • footnote/@type becomes footnote/@role unless the value of footnote/@type is "default" or "annotation", in which case footnote/@type is suppressed and footnote/@role is not generated.
    • If footnote/fnbody contains p/refpt and the value of refpt/@id is the same as the value of footnote/@fntoken, then the refpt should be suppressed because a ref:anchor with the same value in @id is created as child of the target footnote

    • If footnote appears without fnr the footnote contents should still be output as footnote.

    The fnr markup for NL schema as described below:

    • fnr becomes footnote-ref.
    • @fntoken becomes @anchoridref.
    • @fnrtoken becomes footnote-ref/ref:anchor[@id] the value must be unique.
    • The fnr content becomes label
    • fnr/@id becomes footnote-ref/@xml:id.

      Note: All xml:id attributes that begin with a number must have an underscore added at start.

      Note: @anchoridref that begins with a number must have an underscore added at start. Also apply other identifier data type format as used for xml:id and ref:anchor/@id (e.g. change colon to underscore).

    • fnr/@alt-label should be suppressed from conversion because this attribute is already deprecated in the DTD itself.
    • If input documents is having scenario leg:bodytext/fnr then it becomes primlaw:bodytext/textitem/footnote-ref.

    Use the matching criteria below to ensure hyperlinks are working:

    • Use the @fnrtoken attribute to match the source footnote reference indicated by fnr with the actual source footnote content contained in the footnote.

    • If appears without footnote then conversion need to put the reference (fnr) in an xml comment along with this note: footnote reference without footnote is a data error. .

    • If fnr is empty, then it should be suppressed.

    • Exceptional scenario for UK22CS: Supress @type="editorial" attribute from footnote element in target.

      Note: This instruction should be revisited and possibly changed if “editorial” is actually used more appropriately in the future.

    • lilabel/fnr becomes label/footnote-ref

    If footnotegrp is a child of legfragment, then it becomes primlaw:excerpt/primlaw:bodytext/p/text/footnotegroup.

    Source XML

     <p> <pnum count="2">[2]</pnum> <refpt
                        id="20101NZLR_297_p2" type="ext"/> <text>Part 2 of the Commerce Act
                        prohibits various restrictive practices, namely practices substantially
                        lessening competition, <fnr fnrtoken="fnr-20101NZLR_297-1"
                        fntoken="fn-20101NZLR_297-1">1</fnr> price fixing </text>
                        </p> .... <footnotegrp> <footnote fnrtokens="fnr-20101NZLR_297-1"
                        fntoken="fn-20101NZLR_297-1"> <fnlabel>1</fnlabel> <fnbody>
                        <p> <text>Sections 27 &#x2013; 29.</text> </p>
                        </fnbody> </footnote> </footnotegrp> 

    Target XML

     <p> <ref:anchor id="_20101NZLR_297_p2" anchortype="global"/>
                        <desig value="2">[2]</desig> <text>Part 2 of the Commerce Act
                        prohibits various restrictive practices, namely practices substantially
                        lessening competition, <footnote-ref anchoridref="fn-20101NZLR_297-1">
                        <ref:anchor id="fnr-20101NZLR_297-1"/> <label>1</label>
                        </footnote-ref>price fixing </text> </p> <footnotegroup>
                        <footnote> <ref:anchor id="fn-20101NZLR_297-1"/>
                        <ref:returnreference> <ref:locator anchoridref="fnr-20101NZLR_297-1"
                        anchortype="local"/> </ref:returnreference>
                        <label>1</label> <bodytext> <p> <text>Sections 27
                        &#x2013; 29.</text> </p> </bodytext> </footnote>
                        </footnotegroup> 

    Source xml: more than one footnote reference points at the same footnote

     <p> <table frame="all" pgwide="1"> <tgroup cols="1"
                        colsep="0" rowsep="0" align="left"> <colspec colwidth="50*" colname="col1"
                        colsep="0" rowsep="0"/> <tbody valign="top"> <row rowsep="0">
                        <entry morerows="0" colsep="0" rowsep="0">Except for land and copyright,
                        <fnr fntoken="PBEP.C5.FN51" fnrtoken="PBEP.C5.FN51-R">51</fnr>
                        equitable interests can be created verbally. In undertaking an estate review,
                        care must be taken to establish the scope of equitable rights that may be
                        embedded in a person&rsquo;s property at the time of review. The
                        practitioner must ensure that the existence and administration of those rights
                        are dealt with in accordance with the instruction of or legal obligations of the
                        client.</entry> </row> </tbody> </tgroup> </table>
                        <text> <fnr fntoken="PBEP.C5.FN51"
                        fnrtoken="PBEP.C5.FN51-R">51</fnr> </text> </p>
                        <footnotegrp> <!-- Etc. --> <footnote fntoken="PBEP.C5.FN51"
                        fnrtokens="PBEP.C5.FN51-R" type="default" > <fnlabel>51</fnlabel>
                        <fnbody> <p> <refpt type="ext"
                        id="PBEP.C5.FN51"/><text>See Copyright Act 1968 (Cth) <ci:cite
                        searchtype="LEG-REF"> <ci:content> <remotelink
                        refpt="IPCPY.CPA.CPA.S8" dpsi="0JVS" docidref="EFGH_9876" remotekey1="REFPTID"
                        service="DOC-ID">ss 8</remotelink> </ci:content></ci:cite>
                        and <ci:cite searchtype="LEG-REF"> <ci:content> <remotelink
                        refpt="IPCPY.CPA.CPA.S196" dpsi="0JVS" docidref="EFGH_9876" remotekey1="REFPTID"
                        service="DOC-ID" >196</remotelink> </ci:content>
                        </ci:cite>. </text> </p> </fnbody> </footnote>
                        </footnotegrp> 

    Target xml: more than one footnote reference points at the same footnote

     <p> <table frame="all" pgwide="1"> <tgroup cols="1"
                        align="left"> <colspec colname="col1" colwidth="50&#x002A;"/>
                        <tbody valign="top"> <row> <entry>Except for land and
                        copyright, <footnote-ref anchoridref="PBEP.C5.FN51"> <ref:anchor
                        id="PBEP.C5.FN51-R"/> <label>51</label> </footnote-ref>
                        equitable interests can be created verbally. In undertaking an estate review,
                        care must be taken to establish the scope of equitable rights that may be
                        embedded in a person&#x2019;s property at the time of review. The
                        practitioner must ensure that the existence and administration of those rights
                        are dealt with in accordance with the instruction of or legal obligations of the
                        client. </entry> </row> </tbody> </tgroup>
                        </table> <text> <footnote-ref anchoridref="PBEP.C5.FN51">
                        <ref:anchor id="PBEP.C5.FN51-R_1"/> <label>51</label>
                        </footnote-ref> </text> </p> <footnotegroup>
                        <footnote> <ref:anchor id="PBEP.C5.FN51"/>
                        <ref:returnreference> <ref:locator anchoridref="PBEP.C5.FN51-R"
                        anchortype="local"/> </ref:returnreference>
                        <label>51</label> <bodytext> <p> <text>See
                        Copyright Act 1968 &#x0028;Cth&#x0029; <lnci:cite
                        type="legislation"> <lnci:content> <ref:crossreference
                        crossreferencetype="seeAlso"> <ref:content>ss 8</ref:content>
                        <ref:locator anchoridref="IPCPY.CPA.CPA.S8"> <ref:locator-key>
                        <ref:key-name name="DOC-ID"/> <ref:key-value
                        value="0JVS-EFGH_9876"/> </ref:locator-key> </ref:locator>
                        </ref:crossreference> </lnci:content> </lnci:cite> and
                        <lnci:cite type="legislation"> <lnci:content> <ref:crossreference
                        crossreferencetype="seeAlso"> <ref:content>196</ref:content>
                        <ref:locator anchoridref="IPCPY.CPA.CPA.S196"> <ref:locator-key>
                        <ref:key-name name="DOC-ID"/> <ref:key-value
                        value="0JVS-EFGH_9876"/> </ref:locator-key> </ref:locator>
                        </ref:crossreference> </lnci:content> </lnci:cite>.
                        </text> </p> </bodytext> </footnote>
                        </footnotegroup> 

    Source xml: fnr appear without footnote

     <case:factsummary> <p> <text> <fnr
                        fntoken="1ald095fn2" fnrtoken="1ald095fn2-r">1</fnr> Crystal wine
                        glasses sent on behalf of the applicant by post from Sydney to Melbourne were
                        broken in transit. The glasses were packed in individual compartments in a box
                        made of fairly flimsy cardboard and were individually wrapped in tissue paper.
                        There was no external packaging to cushion the box and its contents against
                        damage by impact. The box was marked Fragile. The applicant claimed compensation
                        from the Australian Postal Commission for the breakage of the glasses. His claim
                        was refused on the basis that Postal by-law 292 precluded compensation where the
                        goods damaged were not adequately wrapped to protect them in the ordinary course
                        of transmission. The applicant appealed to the Tribunal asserting that the
                        marking Fragile on the goods should have indicated to the Commission that the
                        goods had to be handled with care. </text> </p> …
                        </case:factsummary> 

    Target xml: fnr appear without footnote

     <casesum:summaries> <casesum:editorialsummar> <p>
                        <text> <!-- a footnote reference without footnote is a data error.
                        <fnr fntoken="1ald095fn2" fnrtoken="1ald095fn2-r">1</fnr> -->
                        Crystal wine glasses sent on behalf of the applicant by post from Sydney to
                        Melbourne were broken in transit. The glasses were packed in individual
                        compartments in a box made of fairly flimsy cardboard and were individually
                        wrapped in tissue paper. There was no external packaging to cushion the box and
                        its contents against damage by impact. The box was marked Fragile. The applicant
                        claimed compensation from the Australian Postal Commission for the breakage of
                        the glasses. His claim was refused on the basis that Postal by-law 292 precluded
                        compensation where the goods damaged were not adequately wrapped to protect them
                        in the ordinary course of transmission. The applicant appealed to the Tribunal
                        asserting that the marking Fragile on the goods should have indicated to the
                        Commission that the goods had to be handled with care. </text> </p>
                        … </casesum:editorialsummar> </casesum:summaries> 

    Source xml: leg:bodytext/fnr scenario

     <leg:bodytext> <fnr fntoken="CPQ.QCAT.QCATPD"
                        fnrtoken="CPQ.QCAT.QCATPD-R">*</fnr> </leg:bodytext> ....
                        <footnotegrp> <footnote fntoken="CPQ.QCAT.QCATPD"
                        fnrtokens="CPQ.QCAT.QCATPD-R" type="default">
                        <fnlabel>*</fnlabel> <fnbody> <p><refpt type="ext"
                        id="CPQ.QCAT.QCATPD"/> <text> &copy; The State of Queensland
                        (Queensland Civil and Administrative Tribunal) 2010. QCAT applications fees
                        reproduced with the kind permission of the Queensland Civil and Administrative
                        Tribunal. See <remotelink href="www.qcat.qld.gov.au" hrefclass="http"
                        newwindow="YES"> www.qcat.qld.gov.au</remotelink> </text>
                        </p> </fnbody> </footnote> </footnotegrp> 

    Target xml: leg:bodytext/fnr scenario

     <primlaw:bodytext> <textitem> <footnote-ref
                        anchoridref="CPQ.QCAT.QCATPD"> <ref:anchor id="CPQ.QCAT.QCATPD-R"/>
                        <label>*</label> </footnote-ref> </textitem>
                        </primlaw:bodytext> <footnotegroup> <footnote> <ref:anchor
                        id="CPQ.QCAT.QCATPD"/> <ref:returnreference> <ref:locator
                        anchoridref="CPQ.QCAT.QCATPD-R" anchortype="local"/>
                        </ref:returnreference> <label>*</label> <bodytext>
                        <p> <text> &#x00A9; The State of Queensland (Queensland Civil
                        and Administrative Tribunal) 2010. QCAT applications fees reproduced with the
                        kind permission of the Queensland Civil and Administrative Tribunal. See <url
                        normval="http://www.qcat.qld.gov.au"> www.qcat.qld.gov.au</url>
                        </text> </p> </bodytext> </footnote>
                        </footnotegroup> 

    Source xml: footnote/fnbody/p/refpt/@id holds the same value as footnote/@fntoken

     <p> <text>The purchaser's solicitor should be careful where
                        a right to rescind arises in the purchaser's favour. In conveyancing matters,
                        the solicitor's knowledge of the right to rescind or the facts giving rise to
                        that right is imputed to the client. The solicitor's conduct may, if care is not
                        taken, amount to an affirmation of the contract as still on foot or a
                        termination of it, notwithstanding the client's ignorance. <fnr
                        fnrtoken="CONN.DAR.11102.ANT2-R" fntoken="CONN.DAR.11102.ANT2">2</fnr>
                        </text> </p> <!-- Etc. --> <footnote
                        fnrtokens="CONN.DAR.11102.ANT2-R" fntoken="CONN.DAR.11102.ANT2"
                        type="default"> <fnlabel>2</fnlabel> <fnbody> <p>
                        <refpt id="CONN.DAR.11102.ANT2" type="ext"/> <text> <ci:cite
                        searchtype="CASE-REF">...</ci:cite> </text> </p>
                        </fnbody> </footnote> 

    Target xml: footnote/fnbody/p/refpt has been suppressed

     <p> <text>The purchaser's solicitor should be careful where
                        a right to rescind arises in the purchaser's favour. In conveyancing matters,
                        the solicitor's knowledge of the right to rescind or the facts giving rise to
                        that right is imputed to the client. The solicitor's conduct may, if care is not
                        taken, amount to an affirmation of the contract as still on foot or a
                        termination of it, notwithstanding the client's ignorance. <footnote-ref
                        anchoridref="CONN.DAR.11102.ANT2"> <ref:anchor
                        id="CONN.DAR.11102.ANT2-R"/> <label>2</label>
                        </footnote-ref> </text> </p> <footnote> <ref:anchor
                        id="CONN.DAR.11102.ANT2"/> <ref:returnreference> <ref:locator
                        anchoridref="CONN.DAR.11102.ANT2-R" anchortype="local"/>
                        </ref:returnreference> <label>2</label> <bodytext>
                        <p> <text> <lnci:cite>...</lnci:cite> </text>
                        </p> </bodytext> </footnote> 

    Source xml: leg:bodytext/footnotegrp scenario

     <leg:bodytext> <p> <text> (a) An oil discharge
                        monitoring and control system approved by the Administration shall be fitted. In
                        considering the design of the oil content meter to be incorporated in the
                        system, the Administration shall have regard to the specification recommended by
                        the Organization. <fnr fntoken="WA_ACT_1987-14_FN"
                        fnrtoken="WA_ACT_1987-14_FN-R">*</fnr> .... </text> </p>
                        <footnotegrp> <footnote fntoken="WA_ACT_1987-14_FN"
                        fnrtokens="WA_ACT_1987-14_FN-R" type="default">
                        <fnlabel>*</fnlabel> <fnbody> <p> <text
                        align="left"> Reference is made to the Recommendation on International
                        Performance Specifications for Oily-Water Separating Equipment and Oil Content
                        Meters adopted by the Organization by Resolution A.233(VII). </text>
                        </p> </fnbody> </footnote> </footnotegrp>
                        </leg:bodytext> 

    Target xml: primlaw:bodytext/p/text/footnotegroup scenario

     <primlaw:bodytext> <p> <text>(a) An oil discharge
                        monitoring and control system approved by the Administration shall be fitted. In
                        considering the design of the oil content meter to be incorporated in the
                        system, the Administration shall have regard to the specification recommended by
                        the Organization. <footnote-ref anchoridref="WA_ACT_1987-14_FN">
                        <ref:anchor id="WA_ACT_1987-14_FN-R"/> <label>*</label>
                        </footnote-ref> .... </text> </p> <p> <text>
                        <footnotegroup> <footnote> <ref:anchor
                        id="WA_ACT_1987-14_FN"/> <ref:returnreference> <ref:locator
                        anchoridref="WA_ACT_1987-14_FN-R" anchortype="local"/>
                        </ref:returnreference> <label>*</label> <bodytext>
                        <p> <text> <p align="left"> <text>Reference is made to
                        the Recommendation on International Performance Specifications for Oily-Water
                        Separating Equipment and Oil Content Meters adopted by the Organization by
                        Resolution A.233(VII). </text> </p> </text> </p>
                        </bodytext> </footnote> </footnotegroup> </text>
                        </p> </primlaw:bodytext> 

    Source xml: bodytext/footnotegrp scenario

     <bodytext> ... <entry colname="c1">Fair Work (State Referral
                        and Consequential and Other Amendments) Act 2009 No&#160;54 <fnr
                        fntoken="WRA.OL.ICAC06.FNT1" fnrtoken="WRA.OL.ICAC06.FNT1-R">*</fnr>
                        </entry> <entry colname="c2">25 June 2009</entry> <entry
                        colname="c3">Sch 14[1]&ndash;[11]: 1 July 2009</entry> ...
                        <footnotegrp> <footnote fntoken="WRA.OL.ICAC06.FNT1"
                        fnrtokens="WRA.OL.ICAC06.FNT1-R" type="default">
                        <fnlabel>*</fnlabel> <fnbody> <h>Editor's
                        note:</h> <p><refpt type="ext" id="WRA.OL.ICAC06.FNT1"/>
                        <text><emph typestyle="bf">Please be aware that item 11, Schedule 14
                        of this Act provides the following:</emph> </text> </p>
                        </fnbody> </footnote> </footnotegrp> </bodytext>
                    

    Target xml: bodytext/p/text/footnotegroup scenario

     <bodytext> ... <entry colname="c1">Fair Work (State Referral
                        and Consequential and Other Amendments) Act 2009 No&#160;54 <footnote-ref
                        anchoridref="WRA.OL.ICAC06.FNT1"> <ref:anchor
                        id="WRA.OL.ICAC06.FNT1-R"/> <label>*</label>
                        </footnote-ref> </entry> <entry colname="c2">25 June
                        2009</entry> <entry colname="c3">Sch 14[1]&ndash;[11]: 1 July
                        2009</entry> .... <p> <text> <footnotegroup>
                        <footnote> <ref:anchor id="WRA.OL.ICAC06.FNT1"/>
                        <ref:returnreference> <ref:locator anchoridref="WRA.OL.ICAC06.FNT1-R"
                        anchortype="local"/> </ref:returnreference>
                        <label>*</label> <bodytext> <h>Editor's note:</h>
                        <p> <text><emph typestyle="bf">Please be aware that item 11,
                        Schedule 14 of this Act provides the following:</emph> </text>
                        </p> </bodytext> </footnote> </footnotegroup>
                        </text> </p> </bodytext> 

    Source xml: Canada only, suppress indent from footnote/fnbody/p[@indent]

     <footnotegrp> <footnote fntoken="fn-1" fnrtokens="fnr-1">
                        <fnlabel>1</fnlabel> <fnbody> <p i="2"
                        indent="1st-line"> <text>Decision...</text> </p>
                        </fnbody> </footnote> ... </footnotegrp> 

    Target xml: Canada only, suppress indent from footnote/fnbody/p[@indent]

     <footnotegroup> <footnote> <ref:anchor id="fn-1"/>
                        <ref:returnreference> <ref:locator anchoridref="fnr-1"
                        anchortype="local"/> </ref:returnreference>
                        <label>1</label> <bodytext> <p>
                        <text>Decision...</text> </p> </bodytext>
                        </footnote> ... </footnotegroup> 

    Source xml: legfragment/footnotegrp

                        
    <legfragment>
        ........
        <footnotegrp>
            <footnote type="endnote" fntoken="d42e225" fnrtokens="d42e222">
                <fnlabel>(*)</fnlabel>
                <fnbody>
                    <p>
                        <text>OJ L 149, 11.6.2005, p 22.’;</text>
                    </p>
                </fnbody>
            </footnote>
        </footnotegrp>
    </legfragment>
    
                    

    Target xml: primlaw:excerpt/primlaw:bodytext/p/text/footnotegroup

                        
    <primlaw:excerpt>
        ..........
        <primlaw:bodytext>
            <p>
                <text>
                    <footnotegroup>
                        <footnote>
                            <ref:anchor id="d42e225"/>
                            <ref:returnreference>
                                <ref:locator anchoridref="d42e222" anchortype="local"/>
                            </ref:returnreference>
                            <label>*</label>
                            <bodytext>
                                <p>
                                    <text>OJ L 149, 11.6.2005, p 22.’;</text>
                                </p>
                            </bodytext>
                        </footnote>
                    </footnotegroup>
                </text>
            </p>
        </primlaw:bodytext>
    </primlaw:excerpt>
    
                    

    Description

    <topicref href="../../common_newest/Rosetta_glp.note-Chof-figure-LxAdv-figure.dita"/>
     end topichead  figure  
     rosetta element: footnote 
     <topicref href="../../common_newest/Rosetta_footnote-LxAdv-footnote.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_footnote-LxAdv-footnote.dita  
     JL: keys for testing 
    
        <xsl:key name="idTypeValue" match="*[@id]" use="@id"/>
        <xsl:key name="idTypeValue" match="*[@ID]" use="@ID"/>
        <xsl:key name="idTypeValue" match="footnote" use="@fntoken"/>
        <xsl:key name="idTypeValue" match="fnr" use="@fnrtoken"/>
        
        <xsl:key name="fnr-footnote-tokens" match="fnr" use="@fntoken"/>
        
        <xsl:include
            href="../../modules/nonamespace/Rosetta_identifier-LxAdv-ID_data_type-HandlingPatternRestrictions.xsl"/>
        
        <xsl:include
            href="../../modules/nonamespace/Rosetta_identifier-LxAdv-ID_data_type-HandlingDuplicates.xsl"/>
        
        <xsl:include href="../../../global/functions/globalFunctions.xsl"/>
        <xsl:include href="../../../global/defaultRules.xsl"/>
        <xsl:include href="../../modules/nonamespace/Rosetta_refpt-LxAdv-ref.anchor.xsl"/>
        <xsl:variable name="streamID" select="HK02"/>
        <xsl:template match="@*|node()">
            <xsl:copy>
                <xsl:apply-templates/>
            </xsl:copy>
        </xsl:template>
         JL: end of code for testing 
    Namespace No namespace
    Match footnotegrp
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="footnotegrp">
      <!--  default behavior   -->
      <xsl:variable name="form-level-types" select="('prec.grp' , 'precgrp' , 'precgrp1' , 'precgrp2' , 'prec' , 'form')"/>
      <xsl:choose>
        <!-- in these scenarios, parent elements should have already been transformed to the appropriate
                bodytext (or other appropriate) parent wrapper, and will need a p/text parent. At least in the 
                generic modules, which I, JL, checked. case:appendix doesn't have the instruction but the examples
                show it, and case:consideredcases may be dicey, depending on how its template is developed. 
                -JL
                -->
        <!-- this clause parent works for UK14 CIs, not sure about anything else - JL -->
        <xsl:when test="parent::frm:div or parent::frm:body or parent::clause or ($streamID=('AU05' , 'NZ09') and (parent::bodytext[parent::level[@leveltype=$form-level-types]]                  or                  parent::bodytext[parent::level[@leveltype='comm.chap'][level[@leveltype=$form-level-types]][not(level[@leveltype='para0'])]]                  or                 parent::blockquote[parent::bodytext[parent::level[@leveltype=$form-level-types]]]                 or                 parent::blockquote[parent::bodytext[parent::level[@leveltype='comm.chap'][level[@leveltype=$form-level-types]][not(level[@leveltype='para0'])]]])                 or parent::bodytext[parent::form] or parent::blockquote[parent::bodytext[parent::form]]                 )">
          <form:p>
            <form:text>
              <footnotegroup>
                <xsl:apply-templates select="@* | node()"/>
              </footnotegroup>
            </form:text>
          </form:p>
        </xsl:when>
        <xsl:when test="$streamID='HK07' and parent::bodytext[parent::level[@leveltype='prec' or @leveltype='prec.grp' or @leveltype='precgrp' or @leveltype='precgrp1' or @leveltype='precgrp2' or parent::comm.chap or ancestor::level[@leveltype = 'prec.grp']]]">
          <form:p>
            <form:text>
              <footnotegroup>
                <xsl:apply-templates select="@* | node()"/>
              </footnotegroup>
            </form:text>
          </form:p>
        </xsl:when>
        <xsl:when test="parent::bodytext or parent::leg:bodytext or parent::case:judgmentbody or parent::case:decisionsummary or parent::case:factsummary or parent::case:references or parent::case:typeofcase or parent::glp:note or parent::blockquote or parent::li or parent::pgrp or parent::case:appendix or parent::case:consideredcases or parent::case:priorhist or parent::note or parent::prelim or parent::jrnl:prelim or parent::sigblock">
          <p>
            <text>
              <footnotegroup>
                <xsl:apply-templates select="/JOURNALDOC/jrnl:body/jrnl:prelim/footnotegrp/footnote[$streamID='CA15']"/>
                <xsl:apply-templates select="@* | node()"/>
              </footnotegroup>
            </text>
          </p>
        </xsl:when>
        <xsl:when test="parent::p">
          <text>
            <footnotegroup>
              <xsl:apply-templates select="@* | node()"/>
            </footnotegroup>
          </text>
        </xsl:when>
        <xsl:otherwise>
          <!--  accounting for these parents even tho the instruction is redundant so I can keep track
                        case:judgements becomes courtcase:opinions
                        case:headnote becomes courtcase:head
                        no intervening p/text needed
                        catchwordgrp parent - one of the catchwordgrp modules indicates where the footnotegroup should be output
                        so I'll assume the placement of footnotegrp is handled there (which is the proper place), 
                        but it takes this option.                  
                        - JL                
                    -->
          <footnotegroup>
            <xsl:apply-templates select="@* | node()"/>
          </footnotegroup>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template footnote
    Namespace No namespace
    Match footnote
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="footnote">
      <footnote>
        <xsl:apply-templates select="@type"/>
        <xsl:variable name="fnDupStatus">
          <xsl:call-template name="amIaDuplicate"/>
        </xsl:variable>
        <xsl:variable name="normalizedfnfntoken">
          <!-- normalize the footnote's fntoken -->
          <xsl:for-each select="@fntoken">
            <xsl:call-template name="normalizeIdString"/>
          </xsl:for-each>
        </xsl:variable>
        <xsl:variable name="normalizedmatchingfnrtoken">
          <!-- normalize the fnrtoken of the first matching fnr -->
          <!-- if there is no match this variable will return empty and that is fine -->
          <xsl:if test="key('fnr-footnote-tokens', @fntoken)">
            <!-- if there is any matching fnr, for the first one... -->
            <xsl:for-each select="key('fnr-footnote-tokens', @fntoken)[1]">
              <xsl:for-each select="@fnrtoken">
                <xsl:call-template name="normalizeIdString"/>
              </xsl:for-each>
            </xsl:for-each>
          </xsl:if>
        </xsl:variable>
        <xsl:variable name="isSpecialMatchingConditionMet" select="if ($normalizedfnfntoken = $normalizedmatchingfnrtoken and count(key('idTypeValue', @fntoken)) < 3                 and  not(key('idTypeValue' , concat($normalizedmatchingfnrtoken , '_R')))                 ) then 0 else 1"/>
        <!-- we're only going to increment if we have 2 of the same input tokens or less (1 each fntoken, fnrtoken).  Otherwise, too messy -->
        <!-- we're not going to increment if the incremented value is already an ID. No point in it. -->
        <!-- 0 means we have a match, 1 means we failed to match anything -->
        <xsl:choose>
          <xsl:when test="$fnDupStatus = 'false' or $isSpecialMatchingConditionMet=0">
            <ref:anchor>
              <xsl:apply-templates select="@fntoken"/>
              <xsl:if test="$streamID = 'AU15'">
                <xsl:attribute name="anchortype">global</xsl:attribute>
              </xsl:if>
            </ref:anchor>
          </xsl:when>
          <xsl:when test="starts-with($streamID, 'UK') and @fntoken='0'">
            <!-- generate unique id here, how? -->
            <xsl:variable name="newID">
              <xsl:value-of select="concat('_' , count(preceding::footnote)+1)"/>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="key('idTypeValue', $newID)">
                <xsl:attribute name="id" select="concat($newID, '_footnote_footnote')"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="id" select="$newID"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
          <xsl:otherwise>
            <ref:anchor>
              <!-- Awantika: creating @id as it required with the dummy value -->
              <xsl:attribute name="id">
                <xsl:text>XXXX_</xsl:text>
                <xsl:value-of select="generate-id()"/>
              </xsl:attribute>
              <xsl:comment>Data Error: footnote token was a duplicate or missing id and has been removed. ref:anchor output with autogenerated @id.</xsl:comment>
            </ref:anchor>
            <!-- use default rules to throw an error message here, need error code -->
            <xsl:call-template name="outputErrorMessage">
              <xsl:with-param name="messageText" as="xs:string" select=" 'Data Error: footnote token was a duplicate or missing id and has been removed.                             ref:anchor output with autogenerated @id. ' "/>
              <xsl:with-param name="errorType" as="xs:string" select=" 'ICCE' "/>
              <xsl:with-param name="errorCode" as="xs:string*" select=" 'TBD' "/>
              <xsl:with-param name="context" as="xs:string">
                <xsl:value-of select="base-uri()"/>
              </xsl:with-param>
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:if test="key('fnr-footnote-tokens', @fntoken) or ($isSpecialMatchingConditionMet=0)">
          <xsl:for-each select="key('fnr-footnote-tokens', @fntoken)[1]">
            <ref:returnreference>
              <ref:locator>
                <xsl:attribute name="anchoridref">
                  <xsl:choose>
                    <xsl:when test="$isSpecialMatchingConditionMet=0">
                      <xsl:value-of select="concat($normalizedmatchingfnrtoken , '_R')"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:for-each select="@fnrtoken">
                        <xsl:call-template name="normalizeIdString"/>
                      </xsl:for-each>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:attribute>
                <xsl:attribute name="anchortype">local</xsl:attribute>
              </ref:locator>
            </ref:returnreference>
          </xsl:for-each>
        </xsl:if>
        <xsl:apply-templates/>
      </footnote>
    </xsl:template>
    Template footnote/fnlabel
    Namespace No namespace
    Match footnote/fnlabel
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="footnote/fnlabel">
      <label>
        <xsl:apply-templates select="@* | node()"/>
      </label>
    </xsl:template>
    Template footnote/fnbody
    Namespace No namespace
    Match footnote/fnbody
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="footnote/fnbody">
      <!--  Original Target XPath:  footnote/bodytext   -->
      <bodytext>
        <xsl:apply-templates select="@* | node()"/>
      </bodytext>
    </xsl:template>
    Template footnote/@type
    Documentation

    Description

     JD: SharedServices schemas only allow @role of 'footnote' or 'endnote'; removing $streamID as @role='editorial' is not allowed in ANY stream. 
    Namespace No namespace
    Match footnote/@type
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="footnote/@type">
      <xsl:choose>
        <xsl:when test=". = 'editorial'"/>
        <!--  and $streamID='UK08CA'  -->
        <!--<xsl:when test=". = 'editorial' and $streamID='UK09' "/>-->
        <!-- AS:For UK09 if role ="editorial" comes then validation error is coming as contravenes to footnote ,endnot role -->
        <xsl:when test=".!='default' and .!='annotation'">
          <xsl:attribute name="role">
            <xsl:value-of select="."/>
          </xsl:attribute>
        </xsl:when>
      </xsl:choose>
    </xsl:template>
    Template footnote/@fntoken
    Namespace No namespace
    Match footnote/@fntoken
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="footnote/@fntoken">
      <!--for use in ref:anchor
                This shouldn't be applied unless we've already removed duplicates -->
      <xsl:attribute name="id">
        <xsl:call-template name="normalizeIdString"/>
      </xsl:attribute>
    </xsl:template>
    Template fnbody/p/@indent[starts-with($streamID, 'CA')]
    Documentation

    Description

     Vikas Rohilla : Added the priority for resolve the Ambiguous it matches the Rosetta_p-LxAdv-p.xsl at line  996
    Namespace No namespace
    Match fnbody/p/@indent[starts-with($streamID, 'CA')]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="fnbody/p/@indent[starts-with($streamID, 'CA')]" priority="2"/>
    Template fnr
    Namespace No namespace
    Match fnr
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="fnr">
      <xsl:if test="node() | @*">
        <xsl:choose>
          <!-- see if there is a footnote which has a @fntoken matching this fnr/@fntoken 
                    could try 2nd attmept with @fnrtoken / @fnrtokens but that requires new key
                    -->
          <!-- JD: 2017-06-14: adding additional keys; data clearly has matching tokens that aren't picked up by existing keys -->
          <xsl:when test=" key('idTypeValue', @fntoken)[self::footnote]">
            <!--xsl:when test="key('idTypeValue', @fntoken)[self::footnote]"-->
            <xsl:choose>
              <xsl:when test="parent::leg:bodytext">
                <textitem>
                  <xsl:call-template name="outputFootnoteRef"/>
                </textitem>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="outputFootnoteRef"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:when>
          <xsl:otherwise>
            <!-- CSN - 2017/10/25 - Webstar 7026508 - Stream UK06 should not show error message, just comment out fnr if no footnote -->
            <!-- JL 20180104 - Many webstars including email with Andrew Martin and Sivapragasam M. to "turn off" this footnote
                            error message for all AU and NZ streams.  It was already "off" for AU11, AU14, NZ06, NZ08, and NZ18, so those streams won't
                            need to be re-released -->
            <xsl:if test="not($streamID = ('UK01','UK02','UK03','UK06','UK07','UK08OR','UK08CA','UK20') or starts-with($streamID , 'AU') or starts-with($streamID , 'NZ'))">
              <xsl:call-template name="outputErrorMessage">
                <xsl:with-param name="messageText" as="xs:string" select=" 'footnote reference without a footnote is a data error.' "/>
                <xsl:with-param name="errorType" as="xs:string" select=" 'ICCE' "/>
                <xsl:with-param name="errorCode" as="xs:string*" select=" 'TBD' "/>
                <xsl:with-param name="context" as="xs:string">
                  <xsl:value-of select="base-uri()"/>
                </xsl:with-param>
              </xsl:call-template>
            </xsl:if>
            <xsl:comment>
              <xsl:text>footnote reference without a footnote is a data error. </xsl:text>
              <xsl:copy-of select="."/>
            </xsl:comment>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </xsl:template>
    Template outputFootnoteRef
    Namespace No namespace
    Used by
    Template
    References
    Import precedence 0
    Source
    <xsl:template name="outputFootnoteRef">
      <!--saves typing multiple times-->
      <footnote-ref>
        <xsl:apply-templates select="@id"/>
        <xsl:apply-templates select="@fntoken"/>
        <xsl:variable name="fnrDupStatus">
          <xsl:call-template name="amIaDuplicate"/>
        </xsl:variable>
        <xsl:variable name="normalizedfnrfnrtoken">
          <!-- normalize the footnote's fntoken -->
          <xsl:for-each select="@fnrtoken">
            <xsl:call-template name="normalizeIdString"/>
          </xsl:for-each>
        </xsl:variable>
        <xsl:variable name="normalizedmatchingfnsfntoken">
          <!-- normalize the value of fnrtokens for each matching footnote
                    If there are multiples, it won't work, I'll consider it's just not a match and we move on.
                    -->
          <!-- if there is no match or this variable will return empty and that is fine -->
          <xsl:for-each select="key('idTypeValue' , @fntoken)[self::footnote]">
            <xsl:for-each select="(@fntoken)">
              <xsl:call-template name="normalizeIdString"/>
            </xsl:for-each>
          </xsl:for-each>
        </xsl:variable>
        <xsl:variable name="isSpecialfnrMatchingConditionMet" select="if ($normalizedfnrfnrtoken = $normalizedmatchingfnsfntoken                 and count(key('idTypeValue', @fnrtoken)) < 3                 and  not(key('idTypeValue' , concat($normalizedfnrfnrtoken , '_R')))                 ) then 0 else 1"/>
        <!-- we're only going to increment if we have 2 of the same input tokens or less (1 each fntoken, fnrtoken).  Otherwise, too messy -->
        <!-- we're not going to increment if the incremented value is already an ID. No point in it. -->
        <!-- 0 means we have a match, 1 means we failed to match anything -->
        <xsl:choose>
          <xsl:when test="$fnrDupStatus = 'false' or $isSpecialfnrMatchingConditionMet=0">
            <xsl:apply-templates select="@fnrtoken">
              <xsl:with-param name="specialMatch" select="$isSpecialfnrMatchingConditionMet"/>
              <xsl:with-param name="incrementedfnrtokenValue" select="concat($normalizedfnrfnrtoken , '_R')"/>
            </xsl:apply-templates>
          </xsl:when>
          <xsl:otherwise>
            <ref:anchor>
              <!-- Awantika: creating @id as it required with the dummy value -->
              <xsl:attribute name="id">
                <xsl:text>XXXX_</xsl:text>
                <xsl:value-of select="generate-id()"/>
              </xsl:attribute>
              <!-- may also need error message output -->
              <!-- wpk 2017-12-11.  Removed comment.  You can read background in webstar 7055608.
                                in short: multiple references to single footnote creates ID problem in that what does user get set "back to" when linking back to reference.
                                App has no way to "link back" to the second (or subsequent) references to a given footnote.  So default behavior is to link back to 
                                the first one.  This limitation confirmed with presentation team.
                            <xsl:comment>footnote reference token was a duplicate or missing id and has been removed. ref:anchor output with generated @id.</xsl:comment>
                            -->
              <!--<xsl:value-of select="name()"/>-->
            </ref:anchor>
            <!-- JL 20171108: this is a data error that rarely causes a problem with footnote linking.  Comma should be sufficient. 
                            LBUs do not want webstars for this, as most of these footnote do not have 2-way linking per CI.
                            webstar 7043982
                        <xsl:call-template name="outputErrorMessage">
                            <xsl:with-param name="messageText" as="xs:string" select=" 'footnote reference token was a duplicate or missing id and has been removed.
                                ref:anchor output with no @id. ' "/>
                            <xsl:with-param name="errorType" as="xs:string" select=" 'ICCE' "/>
                            <xsl:with-param name="errorCode" as="xs:string*" select=" 'TBD' "/>
                            <xsl:with-param name="context" as="xs:string"><xsl:value-of select="base-uri()"/></xsl:with-param>
                        </xsl:call-template>  -->
          </xsl:otherwise>
        </xsl:choose>
        <label>
          <xsl:apply-templates select="node()"/>
        </label>
      </footnote-ref>
    </xsl:template>
    Template fnr/@fnrtoken
    Namespace No namespace
    Match fnr/@fnrtoken
    Mode #default
    References
    Parameters
    QName Namespace Select
    incrementedfnrtokenValue No namespace
    specialMatch No namespace '1'
    Import precedence 0
    Source
    <xsl:template match="fnr/@fnrtoken">
      <!-- output only after dup check -->
      <xsl:param name="specialMatch" select="'1'"/>
      <xsl:param name="incrementedfnrtokenValue"/>
      <ref:anchor>
        <xsl:attribute name="id">
          <xsl:choose>
            <xsl:when test="$specialMatch=0">
              <xsl:value-of select="$incrementedfnrtokenValue"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:call-template name="normalizeIdString"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
      </ref:anchor>
    </xsl:template>
    Template fnr/@fntoken
    Namespace No namespace
    Match fnr/@fntoken
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="fnr/@fntoken">
      <!-- 
            No dup check necessary-->
      <xsl:attribute name="anchoridref">
        <xsl:call-template name="normalizeIdString"/>
      </xsl:attribute>
    </xsl:template>
    Template fnr/@alt-label
    Namespace No namespace
    Match fnr/@alt-label
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="fnr/@alt-label"/>
    Template footnote/fnbody/p/refpt
    Namespace No namespace
    Match footnote/fnbody/p/refpt
    Mode #default
    References
    Template
    Import precedence 0
    Source
    <xsl:template match="footnote/fnbody/p/refpt">
      <xsl:variable name="ancestorFnToken" select="ancestor::footnote/@fntoken"/>
      <xsl:if test="refpt/@id!=$ancestorFnToken">
        <xsl:call-template name="refpt-generic"/>
      </xsl:if>
    </xsl:template>
    Template form-chars
    Documentation

    Description

    Instructions [common element]

    form-chars becomes proc:formchars and includes the attributes @formchar and @formcharuse. Attributes @formchar and @formcharuse are required attributes in proc:formchars and the values for these attributes are tokenized in the NewLexis Schema.

    Attribute @formchar allows the tokenized values listed below:

    • proc:formchars[@formchar="dot"]
    • proc:formchars[@formchar="rule"]
    • proc:formchars[@formchar="dbl-rule"]
    • proc:formchars[@formchar="hypen"]
    • proc:formchars[@formchar="invisible"]
    Below are the values for proc:formchars[@formchar] found in the source documents and the corresponding mapping in NewLexis.
    • form-chars[@character="."] becomes proc:formchars[@formchar="dot"]
    • form-chars[@character="_"] becomes proc:formchars[@formchar="rule"]
    • form-chars[@character="underline"] becomes proc:formchars[@formchar="rule"]
    • form-chars[@character="-"] becomes proc:formchars[@formchar="hypen"]
    • form-chars[@character=" "] becomes proc:formchars[@formchar="invisible"]
    • form-chars[@character=""] becomes proc:formchars[@formchar="invisible"]
    • form-chars[@character="&nbsp;"] becomes proc:formchars[@formchar="invisible"]

    Attribute @formcharuse values are listed below:

    • proc:formchars[@formcharuse="date"]
    • proc:formchars[@formcharuse="day"]
    • proc:formchars[@formcharuse="month"]
    • proc:formchars[@formcharuse="year"]
    • proc:formchars[@formcharuse="num"]
    • proc:formchars[@formcharuse="money"]
    • proc:formchars[@formcharuse="address"]
    • proc:formchars[@formcharuse="name"]
    • proc:formchars[@formcharuse="longname"]
    • proc:formchars[@formcharuse="leaderfill"] @formcharuse="leaderfill" means fill the available space with the formchar. Basically, push the text on each side out to the margins if possible.
    • proc:formchars[@formcharuse="other"]
    The following are the widths (in points) used for this element in print for each possible value of @formcharuse. To determine the number of characters, divide the point value by 6.
    • proc:formchars[@formcharuse="date"] 66 ->11
    • proc:formchars[@formcharuse="day"] 36 ->6
    • proc:formchars[@formcharuse="month"] 48 -> 8
    • proc:formchars[@formcharuse="year"] 36 -> 6
    • proc:formchars[@formcharuse="num"] 36 -> 6
    • proc:formchars[@formcharuse="money"] 42 -> 7
    • proc:formchars[@formcharuse="address"] 72 -> 12
    • proc:formchars[@formcharuse="name"] 66 -> 11
    • proc:formchars[@formcharuse="longname"] 132 -> 22
    • proc:formchars[@formcharuse="other"] 66 -> 11
    Below are the values for proc:formchars[@formcharuse] found in the source documents and the corresponding mapping in NewLexis.
    • form-chars[@num-char="2"] becomes proc:formchars[@formcharuse="day"]
    • form-chars[@num-char="4"] becomes proc:formchars[@formcharuse="day"]
    • form-chars[@num-char="8"] becomes proc:formchars[@formcharuse="month"]
    • form-chars[@num-char="12"] becomes proc:formchars[@formcharuse="address"]
    • form-chars[@num-char="16"] becomes proc:formchars[@formcharuse="longname"]

    Note: If the value for @num-char doesn't fall in the above specified list then use higher @formcharuse value in target mapping. For example: If value for form-chars/@num-char is "7" then use "month" as the value for proc:formchars/@formcharuse.

    Source XML

    
    <blockquote>
    <p indent="none">
    <text><form-chars character="_" num-char="7"/></text>
    </p>
    </blockquote>
    
    	

    Target XML

    
    <blockquote>
    <p indent="none">
    <text><proc:formchars formchar="rule" formcharuse="month"/></text>
    </p>
    </blockquote>
    
    	

    Note: If @num-char value goes beyond 22 simply use @formcharuse="longname" except below use case: <form-chars character="dotleader" num-char="55.4" /> will become <proc:formchars formchar="invisible" fromcharuse="leaderfill" />

    Source XML

    
    <blockquote>
    <p indent="none">
    <text><form-chars character="_" num-char="8"/></text>
    </p>
    </blockquote>
    
    	

    Target XML

    
    <blockquote>
    <p indent="none">
    <text><proc:formchars formchar="rule" formcharuse="month"/></text>
    </p>
    </blockquote>
    
    	

    form-chars/@character="line" will become proc:formchars/@formchar="rule".

    Source XML

    
    <form-chars character="line" num-char="6" />
    
    	

    Target XML

    
    <proc:formchars formchar="rule" formcharuse="month"/>
    
    	

    form-chars/@character="blank" will become proc:formchars/@formchar="invisible".

    Source XML

    
    <form-chars character="blank" num-char="40" />
    
    	

    Target XML

    
    <proc:formchars formchar="invisible" formcharuse="longname"/>
    
    	

    In Input if @num-char is not specified it means fill available space.

    Source XML

    
    <form-chars character="." />
    
    	

    Target XML

    
    <proc:formchars formchar="dot" fromcharuse="leaderfill"/>
    
    	

    Description

     <p>If <sourcexml>footnote/fnbody</sourcexml> contains
                                        <sourcexml>p/refpt</sourcexml> and the value of
                                        <sourcexml>refpt/@id</sourcexml> is the same as the value of
                                        <sourcexml>footnote/@fntoken</sourcexml>, then the
                                        <sourcexml>refpt</sourcexml> should be suppressed because a
                                        <targetxml>ref:anchor</targetxml> with the same value in
                                        <targetxml>@id</targetxml> is created as child of the target
                                        <targetxml>footnote</targetxml></p>
     rosetta element: form-chars 
     <topicref href="../../common_newest/Rosetta_form-chars-LxAdv-formchars.dita"/> 
    Namespace No namespace
    Match form-chars
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="form-chars">
      <!--  Original Target XPath:  proc:formchars   -->
      <proc:formchars>
        <xsl:variable name="character" select="@character"/>
        <xsl:variable name="numChar" select="number(@num-char)"/>
        <xsl:attribute name="formchar">
          <xsl:choose>
            <xsl:when test="$character = '.'">dot</xsl:when>
            <xsl:when test="$character = '_'">rule</xsl:when>
            <xsl:when test="$character = 'line'">rule</xsl:when>
            <xsl:when test="$character = 'underline'">rule</xsl:when>
            <xsl:when test="$character = '-'">hyphen</xsl:when>
            <xsl:when test="normalize-space($character) = ''">invisible</xsl:when>
            <xsl:when test="$character = 'blank'">invisible</xsl:when>
            <xsl:when test="$character = ' '">invisible</xsl:when>
            <xsl:when test="$character = ' '">invisible</xsl:when>
            <xsl:when test="$character = '??'">invisible</xsl:when>
            <xsl:when test="$character = 'dotleader'">dot</xsl:when>
            <xsl:when test="$character = 'dotleader' and $numChar = 55.4">invisible</xsl:when>
            <xsl:otherwise>
              <xsl:call-template name="outputErrorMessage">
                <xsl:with-param name="messageText" as="xs:string" select=" 'ERROR:  Rosetta_form-chars-LxAdv-formchars.xsl - The source value is unknown.' "/>
                <xsl:with-param name="errorType" as="xs:string" select=" 'ROCKET' "/>
                <xsl:with-param name="errorCode" as="xs:string*" select=" '502' "/>
                <xsl:with-param name="context" as="xs:string">
                  <xsl:value-of select="base-uri()"/>
                </xsl:with-param>
              </xsl:call-template>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
        <xsl:attribute name="formcharuse">
          <!-- When statements are overlapping in order to match Instructions -->
          <xsl:choose>
            <xsl:when test="string($numChar) = 'NaN'">leaderfill</xsl:when>
            <xsl:when test="$numChar = 55.4 and $character = 'dotleader'">leaderfill</xsl:when>
            <xsl:when test="$numChar > 22">longname</xsl:when>
            <xsl:when test="$numChar le 2">day</xsl:when>
            <xsl:when test="$numChar le 4">day</xsl:when>
            <xsl:when test="$numChar le 8">month</xsl:when>
            <xsl:when test="$numChar le 12">address</xsl:when>
            <xsl:when test="$numChar le 16">longname</xsl:when>
            <xsl:when test="$numChar le 22">longname</xsl:when>
            <xsl:otherwise>leaderfill</xsl:otherwise>
          </xsl:choose>
        </xsl:attribute>
        <xsl:apply-templates select="node()"/>
      </proc:formchars>
    </xsl:template>
    Template glp:noteglp-note-generic
    Documentation

    Description

    glp:note becomes note and attribute @notetype becomes notetype. The children of glp:note are handled as follows:

    • glp:note/heading becomes note/heading.
    • glp:note/refpt becomes note/ref:anchor.
    • Other children of glp:note should map to children of note/bodytext.

      Ex.

      • glp:note/p becomes note/bodytext/p.
      • glp:note/pgrp becomes note/bodytext/pgrp.
      • glp:note/table becomes note/bodytext/table.
      • glp:note/h becomes note/bodytext/h.
      • glp:note/blockquote becomes note/bodytext/blockquote.
      • glp:note/page becomes note/bodytext/ref:page.

    Source XML

    
    <glp:note>
    	<refpt id="257_ALR_1_1" type="ext"/>
    </glp:note>
    
                

    Target XML

    
    <note>
    	<ref:anchor id="au_257_ALR_1_1" anchortype="global"/>
    </note>
    
    	

    Source XML

    
    <glp:note notetype="warning">
    <p><text>Editor's Note: This document contains the full text of sections 1 to 70 and the Schedule. The Appendices to the Act are found in a separate document. Please conduct a cite search for "S.B.C. 1999, c. 2" to obtain all relevant documents.Acts Affected: Adoption Act, R.S.B.C. 1996, c. 5; Child, Family and Community Service Act, R.S.B.C. 1996, c. 46; Environmental Assessment Act, R.S.B.C. 1996, c. 119; Estate Administration Act, R.S.B.C. 1996, c. 122;...</text></p>
    </glp:note>
    
                

    Target XML

    
    <note notetype="warning">
    <bodytext>
    <p><text>Editor's Note: This document contains the full text of sections 1 to 70 and the Schedule. The Appendices to the Act are found in a separate document. Please conduct a cite search for "S.B.C. 1999, c. 2" to obtain all relevant documents.Acts Affected: Adoption Act, R.S.B.C. 1996, c. 5; Child, Family and Community Service Act, R.S.B.C. 1996, c. 46; Environmental Assessment Act, R.S.B.C. 1996, c. 119; Estate Administration Act, R.S.B.C. 1996, c. 122;...</text></p>
    </bodytext>
    </note>
    
    	

    Description

     start topichead  glp:note  
     <topicref href="../../common_newest/Rosetta_glp.note-LxAdv-note.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_glp.note-LxAdv-note.dita  
     JD: 2017-08-08: Note that this also processes 'leg:histnote' via template name, called from this module; this was done to match DT output, which groups both under a <notes> wrapper 
    Namespace No namespace
    Match glp:note
    Mode #default
    Used by
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="glp:note" name="glp-note-generic">
      <note>
        <xsl:if test="self::leg:histnote">
          <xsl:attribute name="notetype" select="'historical'"/>
        </xsl:if>
        <xsl:if test="$streamID='AU18' and child::heading/desig/designum/refpt">
          <xsl:attribute name="notetype" select="'jurisdiction-variant'"/>
        </xsl:if>
        <xsl:choose>
          <xsl:when test="$streamID='AU18' and ./@id = descendant::refpt/@id"/>
          <xsl:otherwise>
            <xsl:apply-templates select="@id"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:apply-templates select="@* except @id"/>
        <!-- from 
                    DITA/ConversionInstructions/Rosetta/common_newest/Rosetta_leg.comntry-level_LEVELTYPE_GROUP-LxAdv-annot.annotations-annot.annotation-grp.dita
                and other annotation CIs-->
        <xsl:if test="not(@notetype) and ancestor::level[ancestor::leg:comntry] and not(descendant::inlineobject | following-sibling::inlineobject)">
          <xsl:attribute name="notetype" select="'xref'"/>
        </xsl:if>
        <xsl:apply-templates select="refpt | heading/descendant::refpt"/>
        <xsl:apply-templates select="heading"/>
        <!-- SS: template added for handling heading and h under caseinfo for NZ03 cases-->
        <xsl:if test="preceding-sibling::heading[parent::caseinfo][$streamID='NZ03']">
          <xsl:apply-templates select="preceding-sibling::heading[parent::caseinfo]"/>
          <xsl:apply-templates select="preceding-sibling::h[parent::caseinfo]"/>
        </xsl:if>
        <xsl:if test="child::*[not(self::heading)][not(self::refpt)]">
          <bodytext>
            <!-- Awantika: if remotelink is the child of glp:note then p/text is required -->
            <xsl:choose>
              <xsl:when test="child::remotelink or not(child::p/child::table or child::p/child::text) and $streamID=('HK03, NZ03')">
                <p>
                  <text>
                    <xsl:apply-templates select="child::* except (heading | refpt)"/>
                  </text>
                </p>
              </xsl:when>
              <!--Satbir: Added condition for handling "glp:note/p/table"-->
              <xsl:when test="child::p/child::table or child::p/child::text and $streamID='NZ03'">
                <xsl:apply-templates select="child::* except (heading | refpt)"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:apply-templates select="child::* except (heading | refpt)"/>
              </xsl:otherwise>
            </xsl:choose>
          </bodytext>
        </xsl:if>
      </note>
    </xsl:template>
    Template glp:note/@notetype
    Namespace No namespace
    Match glp:note/@notetype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="glp:note/@notetype">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template glp:note[parent::lilabel][$streamID=('CA01','CA04')]
    Documentation

    Description

     Vikas Rohilla : Updated for the streamID CA01 
    Namespace No namespace
    Match glp:note[parent::lilabel][$streamID=('CA01','CA04')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="glp:note[parent::lilabel][$streamID=('CA01','CA04')]">
      <xsl:value-of select="."/>
    </xsl:template>
    Template glp:note[parent::dig:info[parent::dig:collection]][$streamID='CA14']
    Documentation

    Description

     Vikas Rohilla : Updated for the streamID CA14    
    Namespace No namespace
    Match glp:note[parent::dig:info[parent::dig:collection]][$streamID='CA14']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="glp:note[parent::dig:info[parent::dig:collection]][$streamID='CA14']">
      <xsl:text disable-output-escaping="yes"><!--</xsl:text>
      <xsl:copy-of select="." copy-namespaces="no"/>
      <xsl:text disable-output-escaping="yes">--></xsl:text>
    </xsl:template>
    Template glp:note[parent::case:headnote][$streamID='NZ04']
    Namespace No namespace
    Match glp:note[parent::case:headnote][$streamID='NZ04']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="glp:note[parent::case:headnote][$streamID='NZ04']">
      <caseinfo:caseinfo>
        <note>
          <bodytext>
            <xsl:apply-templates/>
          </bodytext>
        </note>
      </caseinfo:caseinfo>
    </xsl:template>
    Template glp:note[$streamID=('AU10','NZ06','NZ13','NZ18')] | leg:histnote[$streamID=('AU10','NZ06','NZ13','NZ18')]glp-note-mergesiblings
    Documentation

    Description

     paul: this is a template that merges sibling glp:notes into <notes> wrapper.  add your stream id if you want to use it rather than the generic above 
        		JD: Note that in order to merge this must NOT be called from a for-each; see below template
        		JD: 2017-08-10: added 'leg:histnote' as well, as (at least in NZ06) these are grouped under the same <notes> wrapper.
        
    Namespace No namespace
    Match glp:note[$streamID=('AU10','NZ06','NZ13','NZ18')] | leg:histnote[$streamID=('AU10','NZ06','NZ13','NZ18')]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="glp:note[$streamID=('AU10','NZ06','NZ13','NZ18')] | leg:histnote[$streamID=('AU10','NZ06','NZ13','NZ18')]" name="glp-note-mergesiblings" priority="2">
      <xsl:choose>
        <xsl:when test=".=''"/>
        <xsl:when test="parent::level or parent::heading/parent::level">
          <!-- these get mapped to prelim, which can't contain notes plural wrapper -->
          <xsl:call-template name="glp-note-generic"/>
        </xsl:when>
        <!-- when this is the first note and there are following sibling notes to be included in it, create wrapper  -->
        <xsl:when test="not(preceding-sibling::*[1][self::glp:note or self::leg:histnote]) and (following-sibling::glp:note or following-sibling::leg:histnote)">
          <notes>
            <xsl:call-template name="glp-note-generic"/>
            <!-- JD: replacing this for-each to (a) include leg:histnote and (b) limit to immediate siblings -->
            <!--<xsl:for-each select="following-sibling::*[name()='glp:note']/preceding-sibling::glp:note">-->
            <xsl:for-each select="following-sibling::glp:note[preceding-sibling::*[1][name()=('glp:note','leg:histnote')]]                   | following-sibling::leg:histnote[preceding-sibling::*[1][name()=('glp:note','leg:histnote')]]">
              <xsl:call-template name="glp-note-generic"/>
            </xsl:for-each>
          </notes>
        </xsl:when>
        <!-- when the immediate preceding sibling is a glp:note it will have been grouped above, do nothing -->
        <xsl:when test="preceding-sibling::*[1][self::glp:note or self::leg:histnote]"/>
        <!-- otherwise, process in generic fashion -->
        <xsl:otherwise>
          <xsl:call-template name="glp-note-generic"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template glp:note[$streamID=('NZ06','NZ13') and parent::leg:bodytext and not(preceding-sibling::*[1][name()=('glp:note','leg:histnote')])] | leg:histnote[$streamID=('NZ06','NZ13') and parent::leg:bodytext and not(preceding-sibling::*[1][name()=('glp:note','leg:histnote')])] glp-note-mergesiblings-from-loop
    Documentation

    Description

     JD: 2017-08-08: new template to group multiple contiguous <glp:note> and <leg:histnote> under <notes> 
    		   when called from a for-each-group (e.g., under <leg:bodytext> created from template priority="30" in /modules/nonamespace/Rosetta_endnote-LxAdv-endnote.xsl)
    	
    Namespace No namespace
    Match glp:note[$streamID=('NZ06','NZ13') and parent::leg:bodytext and not(preceding-sibling::*[1][name()=('glp:note','leg:histnote')])] | leg:histnote[$streamID=('NZ06','NZ13') and parent::leg:bodytext and not(preceding-sibling::*[1][name()=('glp:note','leg:histnote')])]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Priority 3
    Source
    <xsl:template match="glp:note[$streamID=('NZ06','NZ13') and parent::leg:bodytext   and not(preceding-sibling::*[1][name()=('glp:note','leg:histnote')])]    | leg:histnote[$streamID=('NZ06','NZ13') and parent::leg:bodytext   and not(preceding-sibling::*[1][name()=('glp:note','leg:histnote')])]    " name="glp-note-mergesiblings-from-loop" priority="3">
      <xsl:choose>
        <xsl:when test=".=''"/>
        <!-- if no content do nothing -->
        <xsl:when test="parent::level or parent::heading/parent::level">
          <!-- these get mapped to prelim, which can't contain notes plural wrapper -->
          <xsl:call-template name="glp-note-generic"/>
        </xsl:when>
        <!-- when this is the first note and there are following sibling notes to be included in it, create wrapper  -->
        <xsl:when test="not(preceding-sibling::*[1][self::glp:note or self::leg:histnote])     and (following-sibling::*[1][name()=('glp:note','leg:histnote')])">
          <notes>
            <!-- process the first note -->
            <xsl:call-template name="glp-note-generic"/>
            <!-- 
    					group immediate sibling notes (logic modified from https://gist.github.com/empo/1105204 )
    					-->
            <xsl:variable name="children" select="following-sibling::glp:note | following-sibling::leg:histnote"/>
            <xsl:for-each select="following-sibling::*">
              <xsl:variable name="index" select="position()"/>
              <xsl:if test="         generate-id( . ) = generate-id( $children[$index] )">
                <xsl:call-template name="glp-note-generic"/>
              </xsl:if>
            </xsl:for-each>
          </notes>
        </xsl:when>
        <!-- when the immediate preceding sibling is a glp:note it will have been grouped above, do nothing -->
        <xsl:when test="preceding-sibling::*[1][self::*[name()=('glp:note','leg:histnote')]]"/>
        <!-- otherwise, process in generic fashion -->
        <xsl:otherwise>
          <xsl:call-template name="glp-note-generic"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template glp:note[$streamID=('AU14')]
    Namespace No namespace
    Match glp:note[$streamID=('AU14')]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Source
    <xsl:template match="glp:note[$streamID=('AU14')]">
      <xsl:choose>
        <xsl:when test="self::glp:note[following-sibling::level | preceding-sibling::level]">
          <bodytext>
            <xsl:call-template name="AU14-glp-note"/>
          </bodytext>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="AU14-glp-note"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template AU14-glp-note
    Namespace No namespace
    Used by
    Import precedence 0
    Source
    <xsl:template name="AU14-glp-note">
      <note>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="refpt"/>
        <xsl:apply-templates select="heading"/>
        <xsl:apply-templates select="contrib"/>
        <xsl:if test="child::*[not(self::heading)][not(self::refpt)][not(self::contrib)]">
          <bodytext>
            <xsl:apply-templates select="child::* except (heading | refpt | contrib)"/>
          </bodytext>
        </xsl:if>
      </note>
    </xsl:template>
    Template glp:note[parent::text][$streamID='AU01']
    Documentation

    Description

     Awantika:2017-10-31- added template for AU01.
    		If glp:note is the child of text then glp:note becomes inlinenote with attribute @notetype="editor-note" 
    Namespace No namespace
    Match glp:note[parent::text][$streamID='AU01']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="glp:note[parent::text][$streamID='AU01']">
      <inlinenote>
        <xsl:attribute name="notetype" select="'editor-note'"/>
        <xsl:value-of select="."/>
      </inlinenote>
    </xsl:template>
    Template text/glp:note[$streamID='CA01' or $streamID='CA02CC' or $streamID='CA04' ]
    Documentation

    Description

    • If glp:note is the child of text then glp:note becomes inlinenote with attribute @notetype="editor-note"
    • If p/text is the child of glp:note then conversion should suppress p/text element only and PCDATA of this directly goes into inlinenote.

    Source XML

    
    <p>
      <text>
        <glp:note>
            <p nl="0">
                <text>[Editor's note: Figure 1 could not be reproduced online. Please 
    contact Quicklaw Customer Service at 1-800-387-0899 or service@quicklaw.com and request 
    the following document: 07aeub57Figure1.doc]</text>
          </p>
        </glp:note> A number of area residents expressed opposition to the proposed wells, as described below. 
      </text>
    </p>
    
    

    Target XML

    
    <p>
      <text>
        <inlinenote notetype="editor-note">      
            [Editor's note: Figure 1 could not be reproduced online. 
    Please contact Quicklaw Customer Service at 1-800-387-0899 or service@quicklaw.com and 
    request the following document: 07aeub57Figure1.doc]        
        </inlinenote> A number of area residents expressed opposition to the proposed wells, as described below. 
    </text>
    </p>
    
    

    Description

     Awantika: Not in GDS 
     <topicref href="../../common_newest/Rosetta_glp.note_blockquote_p_text_inlineobject-LxAdv-note_bodytext_p_text.dita"/> 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    <xsl:include
    		href="../../modules/glp/Rosetta_glp.note_blockquote_p_text_inlineobject-LxAdv-note_bodytext_p_text.xsl"/>
    	<!-\- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -\->
    	<!-\- <topicref href="../../common_newest/Rosetta_glp.note-Chof-p-LxAdv-note.dita"/> -\->
    	<xsl:include href="../../modules/glp/Rosetta_glp.note-Chof-p-LxAdv-note.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_glp.note-Chof-level_heading-LxAdv-seclaw.level_seclaw.prelim_note.dita"/> -\->
    	<!-\- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -\->
    	<xsl:include
    		href="../../modules/glp/Rosetta_glp.note-Chof-level_heading-LxAdv-seclaw.level_seclaw.prelim_note.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_glp.note-Chof-leg.comntry_level-LxAdv-annot.annotation_bodytext_note.dita"/> -\->
    	<!-\- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -\->
    	<xsl:include
    		<!-\- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -\->
    		href="../../modules/glp/Rosetta_glp.note-Chof-leg.comntry_level-LxAdv-annot.annotation_bodytext_note.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_glp.note-Chof-leg.comntry_level_level-LxAdv-annot.annotationlevel_annot.bodytext_note.dita"/> -\->
    	<xsl:include
    		href="../../modules/glp/Rosetta_glp.note-Chof-leg.comntry_level_level-LxAdv-annot.annotationlevel_annot.bodytext_note.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_glp.note-Chof-leg.heading-LxAdv-primlaw.level_note.dita"/> 
    	<xsl:include href="../../modules/glp/Rosetta_glp.note-Chof-leg.heading-LxAdv-primlaw.level_note.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_glp.note-Chof-text-LxAdv-inlinenote.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_glp.note-Chof-text-LxAdv-inlinenote.dita  
     Vikas Rohilla : Initial created the text/glp:note
     Sudhanshu Srivastava added CA02 Stream ID for converting glpnote to inline 
    Namespace No namespace
    Match text/glp:note[$streamID='CA01' or $streamID='CA02CC' or $streamID='CA04' ]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text/glp:note[$streamID='CA01' or $streamID='CA02CC' or $streamID='CA04' ]">
      <inlinenote>
        <xsl:attribute name="notetype">
          <xsl:text>editor-note</xsl:text>
        </xsl:attribute>
        <xsl:apply-templates/>
      </inlinenote>
    </xsl:template>
    Template emph/glp:note[$streamID='CA01']
    Documentation

    Description

    • If glp:note is the child of emph then glp:note becomes inlinenote with attribute @notetype="editor-note"
    • If p/text is the child of glp:note then conversion should suppress p/text element only and PCDATA of this directly goes into inlinenote.

    Source XML

    
    <p indent="1st-line">
      <text>
        <emph typestyle="bf">
          <glp:note>
             <p>
              <text>
    [Editor's note: Appendix A could not be reproduced online. Please contact Quicklaw Customer 
    Service at 1-800-387-0899 or service@quicklaw.com and request the following document: 
    07bcl217.doc.]</text>
            </p>     
        </glp:note>
      </emph>
     </text>
    </p>
    
    

    Target XML

    
    <p indent="1st-line">
      <text>
        <emph typestyle="bf">
          <inlinenote notetype="editor-note">        
    [Editor's note: Appendix A could not be reproduced online. Please contact Quicklaw Customer 
    Service at 1-800-387-0899 or service@quicklaw.com and request the following document: 
    07bcl217.doc.]
        </inlinenote>
      </emph>
     </text>
    </p>
    
    

    Description

     <topicref href="../../common_newest/Rosetta_glp.note-Chof-emph-LxAdv-inlinenote.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_glp.note-Chof-emph-LxAdv-inlinenote.dita  
     Vikas Rohilla : Initila updated 
    Namespace No namespace
    Match emph/glp:note[$streamID='CA01']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="emph/glp:note[$streamID='CA01']">
      <inlinenote>
        <xsl:attribute name="notetype">
          <xsl:text>editor-note</xsl:text>
        </xsl:attribute>
        <xsl:value-of select="."/>
      </inlinenote>
    </xsl:template>
    Template h
    Namespace No namespace
    Match h
    Mode #default
    References
    Variables
    Import precedence 0
    Source
    <xsl:template match="h">
      <xsl:choose>
        <!-- MDS 2017-05-12 - Added to match DT Output -->
        <xsl:when test="$streamID = 'UK08CA' and parent::entry">
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:when test="$streamID='UK06'">
          <h>
            <xsl:apply-templates select="@*|node()"/>
          </h>
        </xsl:when>
        <!-- 2017-10-19 MDS: Added handling for parent:clause[parent::frm:div] -->
        <xsl:when test="(parent::bodytext|parent::blockquote|parent::frm:*|parent::clause)[parent::form|parent::frm:*|parent::clause[ancestor::frm:divs]]">
          <form:h>
            <xsl:if test="@l">
              <xsl:attribute name="level">
                <xsl:value-of select="@l"/>
              </xsl:attribute>
            </xsl:if>
            <xsl:copy-of select="@* except (@typesize|@l)"/>
            <xsl:apply-templates select="node()"/>
          </form:h>
        </xsl:when>
        <!-- 20170601:  MCJ:  Excluding AU06 from this condition because the regulation schema does not support base:entry/base:toc. -->
        <!-- JL added AU05 -->
        <!-- 2017-11-15: JD: Excluding UK01. 
            Rather than add all to this exclude list maybe we should specifically INCLUDE what we want(?)
            -->
        <!-- 2017-11-16 - CSN: Added UK03.  webstar 7050317.   
    			Totally agree with JD above.   This logic is backwards. -->
        <xsl:when test="parent::entry and not($streamID = ('AU05','AU06','AU15','NZ09','UK01','UK03','UK09','NZ12','UK07'))">
          <xsl:element name="toc">
            <xsl:element name="toc-entry">
              <heading>
                <xsl:if test="@l">
                  <xsl:attribute name="level">
                    <xsl:value-of select="@l"/>
                  </xsl:attribute>
                </xsl:if>
                <!-- SEP 2015-08-06 looks like there was a missing @ here, added it -->
                <xsl:if test="@align">
                  <xsl:attribute name="align">
                    <xsl:value-of select="@align"/>
                  </xsl:attribute>
                </xsl:if>
                <title>
                  <xsl:apply-templates/>
                </title>
              </heading>
            </xsl:element>
          </xsl:element>
        </xsl:when>
        <xsl:when test="child::inlineobject">
          <figure>
            <!-- SEP 2015-08-06 looks like there was a missing @ here, added it -->
            <xsl:if test="@align">
              <xsl:attribute name="align">
                <xsl:value-of select="@align"/>
              </xsl:attribute>
            </xsl:if>
            <xsl:apply-templates/>
          </figure>
        </xsl:when>
        <!-- MDS - 2017-05-05 - As specified in '/comm/UK08_QUASI_ReguMate_COMMTOADMINDOC-Body.xsl' -->
        <xsl:when test="$streamID = 'UK08CA' and emph/inlineobject">
          <xsl:apply-templates select="node()"/>
        </xsl:when>
        <!-- 2017-12-18 - CSN - Webstar 7074749 - Remove typeofcase.  Handled in that module. -->
        <xsl:when test="(parent::case:decisionsummary) and $streamID='UK03'">
          <bodytext>
            <h>
              <xsl:apply-templates select="@*|node()"/>
            </h>
          </bodytext>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="contains(lower-case($docinfoidtext),'overview') and //source_cttr:annotations[@id='OP15']/heading/note/h[@id='OP15A']">
              <xsl:apply-templates/>
            </xsl:when>
            <xsl:when test="contains(lower-case($docinfoidtext),'analytics') and parent::comm:citations and $streamID='AU20'">
              <xsl:apply-templates/>
            </xsl:when>
            <xsl:otherwise>
              <h>
                <xsl:if test="@l">
                  <xsl:attribute name="level">
                    <xsl:value-of select="@l"/>
                  </xsl:attribute>
                </xsl:if>
                <!-- SEP 2015-08-06 looks like there was a missing @ here, added it -->
                <xsl:if test="@align">
                  <xsl:attribute name="align">
                    <xsl:value-of select="@align"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:apply-templates/>
              </h>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template h/@l
    Namespace No namespace
    Match h/@l
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="h/@l">
      <xsl:choose>
        <xsl:when test="$streamID='UK06'"/>
        <xsl:otherwise>
          <xsl:attribute name="level">
            <xsl:value-of select="."/>
          </xsl:attribute>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template h/@align
    Namespace No namespace
    Match h/@align
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="h/@align">
      <xsl:attribute name="align">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template bodytext/heading[not($streamID='CA14' or $streamID='USLPA')]
    Documentation

    Description

    heading becomes heading and bodytext/heading becomes h. The attributes of heading are handled as follows:

    • heading/@inline is suppressed if target is h. Otherwise, heading/@inline becomes heading/@inline. The valid values for @inline are:
      • "true"
      • "false"
    • heading/@align becomes heading@align. The valid values for @align are:
      • "left"
      • "right"
      • "center"
    • heading/@searchtype should be suppressed.

    Note: Conversion should not create consecutive heading elements. When 2 or more sibling source elements map to heading, the data should be merged into a single heading element unless this would interfere with content ordering.

    Source XML

    
    <heading align="center">
    	<title>Consideration</title>
    </heading>
    
    				

    Target XML

    
    <heading align="center">
      <title>Consideration</title>
    </heading>
    
    		

    Source XML

    
    <heading inline="false">
    	<title>Summary</title>
    </heading>
    
    				

    Target XML

    
    <heading inline="false">
    	  <title>Summary</title>
    </heading>
    
    		

    2013-03-06: Removed instructions/rules for exceptional desig scenario and deprecated attribute @followstitle.


    Description

     Awantika: Not in GDS 
     <topicref href="../../common_newest/Rosetta_h-Chof-entry-LxAdv-entry_toc_toc-entry_heading.dita"/> 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    <xsl:include
    		href="../../modules/nonamespace/Rosetta_h-Chof-entry-LxAdv-entry_toc_toc-entry_heading.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_h-Chof-form_bodytext-LxAdv-form.h.dita"/> -\->
    	<xsl:include href="../../modules/nonamespace/Rosetta_h-Chof-form_bodytext-LxAdv-form.h.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     end topichead  h  
     rosetta element: heading 
     <topicref href="../../common_newest/Rosetta_heading-LxAdv-heading.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_heading-LxAdv-heading.dita  
    Namespace No namespace
    Match bodytext/heading[not($streamID='CA14' or $streamID='USLPA')]
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="bodytext/heading[not($streamID='CA14' or $streamID='USLPA')]">
      <!--   @SBy:  this rule added based on the QC XSLT   -->
      <h>
        <xsl:choose>
          <xsl:when test="$streamID=('UK07','AU14','HK07')">
            <xsl:apply-templates select="title | subtitle" mode="bodytext_heading"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="@* | node()"/>
            <!--    ... When 2 or more sibling source elements map to <targetxml>heading</targetxml>, the data should be merged into a single <targetxml>heading</targetxml> element unless this would interfere with content ordering.</note>     -->
            <xsl:for-each select="following-sibling::node()[1][ self::heading ]">
              <xsl:call-template name="combineSiblingsOfSameName"/>
            </xsl:for-each>
          </xsl:otherwise>
        </xsl:choose>
      </h>
    </xsl:template>
    Template heading
    Namespace No namespace
    Match heading
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="heading">
      <!--  Original Target XPath:  heading   -->
      <heading>
        <!-- MDS 2017-05-05 - Added 'except(refpt) due to UK08CA source markup 
    	JL added leg:empleg to except list - it's addressed elsewhere and not valid here ever -->
        <xsl:apply-templates select="@* | node() except (refpt | leg:empleg)"/>
        <!--    ... When 2 or more sibling source elements map to <targetxml>heading</targetxml>, the data should be merged into a single <targetxml>heading</targetxml> element unless this would interfere with content ordering.</note>     -->
        <xsl:for-each select="following-sibling::node()[1][ self::heading ]">
          <xsl:call-template name="combineSiblingsOfSameName"/>
        </xsl:for-each>
        <xsl:if test="$streamID=('UK06','UK12')">
          <xsl:apply-templates select="following-sibling::note"/>
        </xsl:if>
      </heading>
    </xsl:template>
    Template heading/@searchtype | bodytext/heading/@inline | heading[ preceding-sibling::node()[1][ self::heading ] ]
    Documentation

    Description

    		<li><sourcexml>heading/@searchtype</sourcexml> should be suppressed.</li>  
    		<li><sourcexml>heading/@inline</sourcexml> is suppressed if target is <targetxml>h</targetxml>.  Otherwise, ...  
        ... When 2 or more sibling source elements map to <targetxml>heading</targetxml>, the data should be merged into a single <targetxml>heading</targetxml> element unless this would interfere with content ordering.</note>     
    Namespace No namespace
    Match heading/@searchtype | bodytext/heading/@inline | heading[ preceding-sibling::node()[1][ self::heading ] ]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="heading/@searchtype | bodytext/heading/@inline | heading[ preceding-sibling::node()[1][ self::heading ] ]"/>
    Template heading[ not( parent::bodytext ) ]/@inline
    Namespace No namespace
    Match heading[ not( parent::bodytext ) ]/@inline
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="heading[ not( parent::bodytext ) ]/@inline">
      <!--  Original Target XPath:  @inline   -->
      <xsl:copy-of select=" . "/>
    </xsl:template>
    Template heading/@align
    Namespace No namespace
    Match heading/@align
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="heading/@align">
      <!--  Original Target XPath:  @align   -->
      <xsl:copy-of select=" . "/>
    </xsl:template>
    Template title [$streamID=('UK07','AU14','HK07')]bodytext_heading
    Namespace No namespace
    Match title [$streamID=('UK07','AU14','HK07')]
    Mode bodytext_heading
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="title [$streamID=('UK07','AU14','HK07')]" mode="bodytext_heading">
      <xsl:apply-templates select="@* | node()"/>
    </xsl:template>
    Template subtitle [$streamID=('UK07','AU14','HK07')]bodytext_heading
    Namespace No namespace
    Match subtitle [$streamID=('UK07','AU14','HK07')]
    Mode bodytext_heading
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="subtitle [$streamID=('UK07','AU14','HK07')]" mode="bodytext_heading">
      <xsl:apply-templates select="@* | node()"/>
    </xsl:template>
    Template hrule
    Documentation

    Description

    hrule becomes hrule and attributes @align and @width needs to be supressed and presentation stylesheet will render hrule.

    Note: If hrule[parent::blockquote] hrule should become pgrp/hrule.

    Source XML

    
    <hrule align="true" width="5"/>
    
       

    Target XML

    
    <hrule/>
    
    	

    Description

     rosetta element: hrule 
     <topicref href="../../common_newest/Rosetta_hrule-LxAdv-hrule.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_hrule-LxAdv-hrule.dita  
    Namespace No namespace
    Match hrule
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="hrule">
      <xsl:element name="hrule" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
        <xsl:apply-templates select="@*"/>
      </xsl:element>
    </xsl:template>
    Template hrule[parent::blockquote[not(ancestor::leg:comntry)]]
    Namespace No namespace
    Match hrule[parent::blockquote[not(ancestor::leg:comntry)]]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="hrule[parent::blockquote[not(ancestor::leg:comntry)]]">
      <pgrp>
        <xsl:element name="hrule">
          <xsl:apply-templates select="@*"/>
        </xsl:element>
      </pgrp>
    </xsl:template>
    Template hrule[parent::highlight][$streamID='CA14']
    Documentation

    Description

      Vikas Rohilla : Created the template for the stream CA14   
    Namespace No namespace
    Match hrule[parent::highlight][$streamID='CA14']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="hrule[parent::highlight][$streamID='CA14']"/>
    Template hrule/@align | hrule/@width
    Namespace No namespace
    Match hrule/@align | hrule/@width
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="hrule/@align | hrule/@width"/>
    Template inlineobject[@filename = $inlineobjFilesToSuppress][parent::remotelink][not(parent::remotelink/parent::ci:content) or $streamID=('AU08', 'AU04', 'AU10', 'AU09')]
    Documentation

    Description

    Instructions [common element]

    If the inlineobject is not a diagram or picture illustrating textual material (e.g. a minor icon or symbol that is not otherwise suppressed), inlineobject becomes ref:inlineobject.

    • Create ref:locator and describe as:
      • Create ref:locator-key and describe as:
        • Create ref:key-name with @name="object-key". This line is hard coded.
        • Create ref:key-value with @value, as follows:
          • If inlineobject[@smi] is present, then @value is copied from inlineobject[@filename].
          • If inlineobject[@smi] is not present, then @value="X-Y-Z", where X is LNI, Y is SMI, and Z is filename. LNI and SMI(retreived from CSSM) values are added by "Workflow Generic Image Handlers". The last component "Z" is copied from inlineobject[@filename].
          • Note: If inlineobject[@smi] still add the @filename value as the value of ref:key-value/@value. The correct format of the value will be established using the Generic Image Handler process downstream.

          • If inlineobject[@smi] is not present, conversion program should pass inlineobject[@filename] value to “Generic Image Handler” as is and “Generic Image Handler” will do conversion of filename value as noted above. Conversion of filename replaces underscore, blank, and period with hyphen.
      • Create ref:locator-params and describe as:
        • Create proc:param[@name] and proc:param[@value] pairs as follows:
          • proc:param[@name="componentseq"] with the attribute @value="1". This line is hard coded.
          • proc:param[@name="object-type"] with the attribute @value="image" if the extension of inlineobject[@filename] is either of these values (.jpg, .gif, .png, .tiff and .bmp).
          • proc:param[@name="object-smi"] with the attribute @value. The @value value is from inlineobject[@smi]. If inlineobject[@smi] is not present, obtain SMI from CSSM. This @value assignment is done by conversion program.

            Note: If inlineobject[@smi] is not present, add the following proc:param markup:

            • @name='external-or-local' @value='external'
            • @name='object-server' @value='Blobstore'
            • @name='object-pguid' @value='urn:contentitem'

    • The other attributes of inlineobject are handled as follows:
      • inlineobject/@height becomes ref:inlineobject/@height.
      • inlineobject/@width becomes ref:inlineobject/@width.
      • inlineobject/@attachment should be suppressed.
      • inlineobject/@key should be suppressed.

    Note:

    In the case of icons or other boilerplate images, the inlineobject shall usually be suppressed from conversion and a corresponding product requirement should be created with instructions to instantiate the image on retrieval based on information/semantic markup in the document. This will sometimes include additional attributes being added to target elements created from parent source elements (such as ref:crossreference from remotelink).

    Usually, any icons encountered from the list below should be suppressed. These files should be suppressed for both *.gif and *.png file types.

    • 1.gif
    • 2.gif
    • 3.gif
    • 4.gif
    • 5.gif
    • IconSignalPositive.gif
    • IconSignalNegative.gif
    • IconSignalNeutral.gif
    • IconSignalPossibleNegative.gif
    • IconSignalCiteInfoOnly.gif
    • cbcc.gif
    • leg1.gif
    • mb.gif
    • au_repealed.gif
    • au_exclaim.gif

    Use cases where the LBU feels the product requirement cannot be met if the markup is completely suppressed shall be handled case-by-case, and as usual additional topics will contain specific instructions for these scenarios that override the instructions in this note.

    Source XML. Source @smi present

    
    <p>
        <text> 
            <inlineobject type="image" 
                          smi="98765" 
                          attachment="ln-server" 
                          filename="3S3J-WW80-003F-W39R-00000-00-98765-importantIcon.gif" />
        </text>
    </p>
    
                 

    Target XML. Source @smi present

    
    <p>
        <text>
            <ref:inlineobject>
                <ref:locator>
                    <ref:locator-key>
                        <ref:key-name name="object-key"/>
                        <ref:key-value value="3S3J-WW80-003F-W39R-00000-00-98765-importantIcon"/>
                    </ref:locator-key>
                    <ref:locator-params>
                        <proc:param name="componentseq" value="1"/>
                        <proc:param name="object-type" value="image"/>
                        <proc:param name="object-smi" value="98765"/>
                    </ref:locator-params>
                    </ref:locator>
            </ref:inlineobject>
        </text>
    </p>
    
                 

    Source XML. Source @smi not present

    
    <p>
        <text> 
            <inlineobject type="image" 
                          attachment="ln-server" 
                          filename="importantIcon.gif" />
        </text>
    </p>
    
                 

    Target XML. Source @smi not present

    
    <p>
        <text>       
            <ref:inlineobject>
                <ref:locator>
                    <ref:locator-key>
                        <ref:key-name name="object-key"/>
                        <ref:key-value value="X-Y-importantIcon"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                    </ref:locator-key>
                    <ref:locator-params>
                        <proc:param name="componentseq" value="1"/>
                        <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                        <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                    </ref:locator-params>
                </ref:locator>
            </ref:inlineobject>
        </text>
    </p>
    
                 

    Output example without @smi with real values - Conversion output (Input for the image processor)

                    
    
    <text><figure>
    <ref:inlineobject>
    <ref:locator>
    <ref:locator-key>
    <ref:key-name name="object-key"></ref:key-name>
    <ref:key-value value="06-Capital-Gains-Tax-09(995-1044)-2.gif"></ref:key-value>
    </ref:locator-key>
    <ref:locator-params>
    <proc:param name="componentseq" value="1"></proc:param>
    <proc:param name="object-type" value="IMG"></proc:param>
    <proc:param name="external-or-local" value="external"></proc:param>
    <proc:param name="object-server" value="Blobstore"></proc:param>
    <proc:param name="object-pguid" value="urn:contentItem:"></proc:param>
    </ref:locator-params>
    </ref:locator>
    </ref:inlineobject>
    </figure></text>
    
                

    Image processor output:

    
    
    
                  <text>
                    <figure>
                      <ref:inlineobject>
                        <ref:locator>
                          <ref:locator-key>
                            <ref:key-name name="object-key"/>
                            <ref:key-value value="5M8J-YJF1-JNCK-23YG-00000-00-12634-06-Capital-Gains-Tax-09(995-1044)-2"/>
                          </ref:locator-key>
                          <ref:locator-params>
                            <proc:param name="componentseq" value="1"/>
                            <proc:param name="object-type" value="image"/>
                            <proc:param name="external-or-local" value="external"/>
                            <proc:param name="object-server" value="Blobstore"/>
                            <proc:param name="object-pguid" value="urn:contentItem:5M8J-YJF1-JNCK-23YG-00000-00"/>
                          </ref:locator-params>
                        </ref:locator>
                      </ref:inlineobject>
                    </figure>
                  </text>
    
                

    Description

     start topichead  inlineobject  
     <topicref href="../../common_newest/Rosetta_inlineobject-LxAdv-ref.inlineobject.dita"/> 
     created 2 global parameters to be used in driver, 
            
            <xsl:param name="inlineobjBoilerplateFiles" select="('xxx.gif', 'xxx.png')"/> for boilerplate filenames that ARE
            to be converted to ref:inlineobject.
            
            <xsl:param name="inlineobjFilesToSuppress" select="('yyy.png', 'yyy.gif')"/> for filenames that are to be 
            *SUPPRESSED* from conversion but require special handling elsewhere.  That other handling is not specified in this module
            
            
        
        This will allow us to be LBU-specific in names of files for specific handling.
        
        ALSO REFACTORED this template to a MODE and not a named template so it works for figures as well.
        
        JL
        
     Awantika: Added name for the template to be used in element 'p'  
     JL Suppression is done when inlineobject is a child of remotelink and the grandparent of inlineobject (the parent of remotelink) is not ci:content.
        from DITA/ConversionInstructions/Rosetta/common_newest/Rosetta_AU_legistlation_courtrule_inlineobject-Chof-remotelink-LxAdv-SUPPRESS.dita
    Namespace No namespace
    Match inlineobject[@filename = $inlineobjFilesToSuppress][parent::remotelink][not(parent::remotelink/parent::ci:content) or $streamID=('AU08', 'AU04', 'AU10', 'AU09')]
    Mode #default
    References
    Parameter
    Variable
    Import precedence 0
    Source
    <xsl:template match="inlineobject[@filename = $inlineobjFilesToSuppress][parent::remotelink][not(parent::remotelink/parent::ci:content) or $streamID=('AU08', 'AU04', 'AU10', 'AU09')]"/>
    Template inlineobject[@filename=$inlineobjBoilerplateFiles][not(parent::p) and not(parent::blockquote)]
    Namespace No namespace
    Match inlineobject[@filename=$inlineobjBoilerplateFiles][not(parent::p) and not(parent::blockquote)]
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="inlineobject[@filename=$inlineobjBoilerplateFiles][not(parent::p) and not(parent::blockquote)]">
      <xsl:apply-templates select="." mode="refinline"/>
    </xsl:template>
    Template inlineobject[$streamID='CA14'][not(parent::p) and not(parent::blockquote)]
    Namespace No namespace
    Match inlineobject[$streamID='CA14'][not(parent::p) and not(parent::blockquote)]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="inlineobject[$streamID='CA14'][not(parent::p) and not(parent::blockquote)]">
      <xsl:apply-templates select="." mode="refinline"/>
    </xsl:template>
    Template inlineobject[@filename='leg1.gif' or @filename='leg1.png'][ancestor::blockquote/parent::glp:note]
    Documentation

    Description

     MDS 2017-05-17 - Found in AU04 - Suppress inlineobject that is a descendent of glp.note and has a @filename[contains(., 'leg1')] 
     See module '/glp/Rosetta_glp.note_blockquote_p_text_inlineobject-LxAdv-note_bodytext_p_text.xsl' for documentation. 
    Namespace No namespace
    Match inlineobject[@filename='leg1.gif' or @filename='leg1.png'][ancestor::blockquote/parent::glp:note]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="inlineobject[@filename='leg1.gif' or @filename='leg1.png'][ancestor::blockquote/parent::glp:note]"/>
    Template inlineobject[@filename=$inlineobjBoilerplateFiles][parent::p]
    Namespace No namespace
    Match inlineobject[@filename=$inlineobjBoilerplateFiles][parent::p]
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="inlineobject[@filename=$inlineobjBoilerplateFiles][parent::p]">
      <text>
        <xsl:apply-templates select="." mode="refinline"/>
      </text>
    </xsl:template>
    Template inlineobject[parent::pgrp | parent::p][$streamID='AU09']
    Documentation

    Description

    Below template is created for AU09 and not read the [$inlineobjFilesToSuppress].
    Namespace No namespace
    Match inlineobject[parent::pgrp | parent::p][$streamID='AU09']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="inlineobject[parent::pgrp | parent::p][$streamID='AU09']">
      <figure>
        <xsl:apply-templates select="." mode="refinline"/>
      </figure>
    </xsl:template>
    Template inlineobjectrefinline
    Namespace No namespace
    Match inlineobject
    Mode refinline
    References
    Variable
    Parameters
    QName Namespace Tunnel
    bpf_from_case_filenum No namespace yes
    Import precedence 0
    Source
    <xsl:template match="inlineobject" mode="refinline">
      <xsl:param name="bpf_from_case_filenum" tunnel="yes"/>
      <ref:inlineobject>
        <xsl:choose>
          <xsl:when test="$streamID='USLPA'">
            <ref:locator>
              <ref:locator-key>
                <!-- Awantika: ref:key-value should be the sibling of ref:key-name -->
                <ref:key-name>
                  <xsl:attribute name="name">object-key</xsl:attribute>
                </ref:key-name>
                <ref:key-value>
                  <xsl:attribute name="value">
                    <xsl:value-of select="@filename"/>
                  </xsl:attribute>
                </ref:key-value>
              </ref:locator-key>
              <ref:locator-params>
                <proc:param>
                  <xsl:attribute name="name">componentseq</xsl:attribute>
                  <xsl:attribute name="value">1</xsl:attribute>
                </proc:param>
                <xsl:if test="contains(@filename, 'jpg')  or contains(@filename, 'jpeg') or contains(@filename, 'gif') or contains(@filename, 'png') or contains(@filename, 'tiff') or contains(@filename, 'bmp')">
                  <proc:param>
                    <xsl:attribute name="name">object-type</xsl:attribute>
                    <xsl:attribute name="value">image</xsl:attribute>
                  </proc:param>
                </xsl:if>
                <xsl:choose>
                  <!--
    	                                Paul: Wondering if SMI should be a param just like dpsi.  Its going to get dropped unless something is done.
    	                            -->
                  <xsl:when test="@smi">
                    <proc:param>
                      <xsl:attribute name="name">object-smi</xsl:attribute>
                      <xsl:attribute name="value">
                        <xsl:value-of select="@smi"/>
                      </xsl:attribute>
                    </proc:param>
                  </xsl:when>
                  <xsl:when test="not(@smi) and $streamID=('AU16','CA05','CA09','CA06','AU07', 'AU09','USLPA')">
                    <proc:param>
                      <xsl:attribute name="name">object-smi</xsl:attribute>
                      <xsl:attribute name="value"/>
                    </proc:param>
                    <xsl:comment>Empty @value created by 'Rosetta_inlineobject-LxAdv-ref.inlineobject.xsl'</xsl:comment>
                  </xsl:when>
                  <xsl:otherwise>
                    <!--  Paul: commented out these params, they are for blobstore.  they should be done via this template in Rosetta_inlineobject-to-LxAdv_figure_ref.inlineobject
         <xsl:template match="inlineobject" name="inlineobjblobstore">
                                        <proc:param>
    	                                    <xsl:attribute name="name">external-or-local</xsl:attribute>
    	                                    <xsl:attribute name="value">external</xsl:attribute>
    	                                </proc:param>
    	                                <proc:param>
    	                                    <xsl:attribute name="name">object-server</xsl:attribute>
    	                                    <xsl:attribute name="value">Blobstore</xsl:attribute>
    	                                </proc:param>
    	                                <proc:param>
    	                                    <xsl:attribute name="name">object-pguid</xsl:attribute>
    	                                    <xsl:attribute name="value">urn:contentitem:</xsl:attribute>
    	                                </proc:param>
    -->
                  </xsl:otherwise>
                </xsl:choose>
              </ref:locator-params>
            </ref:locator>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="@*[not(name()='attachment' or name()='key')]" mode="refinline"/>
            <xsl:apply-templates select="@attachment|@key" mode="refinline"/>
            <ref:locator>
              <ref:locator-key>
                <!-- Awantika: ref:key-value should be the sibling of ref:key-name -->
                <ref:key-name>
                  <xsl:attribute name="name">
                    <xsl:value-of select="if ($streamID='CA19x' or $streamID='AU19_CC') then 'attachment-key' else 'object-key'"/>
                  </xsl:attribute>
                </ref:key-name>
                <ref:key-value>
                  <xsl:attribute name="value">
                    <xsl:value-of select="@filename"/>
                  </xsl:attribute>
                </ref:key-value>
              </ref:locator-key>
              <ref:locator-params>
                <proc:param>
                  <xsl:attribute name="name">componentseq</xsl:attribute>
                  <xsl:attribute name="value">1</xsl:attribute>
                </proc:param>
                <xsl:if test="contains(@filename, 'jpg')  or contains(@filename, 'jpeg') or contains(@filename, 'gif') or contains(@filename, 'png') or contains(@filename, 'tiff') or contains(@filename, 'bmp')">
                  <proc:param>
                    <xsl:attribute name="name">
                      <xsl:value-of select="if ($streamID='CA19x' or $streamID='AU19_CC') then 'attachment-type' else 'object-type'"/>
                    </xsl:attribute>
                    <xsl:attribute name="value">image</xsl:attribute>
                  </proc:param>
                </xsl:if>
                <xsl:choose>
                  <!--
    	                                Paul: Wondering if SMI should be a param just like dpsi.  Its going to get dropped unless something is done.
    	                                JD: the CI examples state "This @value assignment is done by conversion program"
    	                            -->
                  <xsl:when test="@smi">
                    <proc:param>
                      <xsl:attribute name="name">object-smi</xsl:attribute>
                      <xsl:attribute name="value">
                        <xsl:value-of select="@filename"/>
                      </xsl:attribute>
                    </proc:param>
                  </xsl:when>
                  <xsl:when test="not(@smi) and $streamID='CA19' or $streamID='AU19_CC' or $streamID='AU18'">
                    <!--these Apollo SMI values come from a John B. email:
    												PCT                  PCSI    Name         SMI
    												urn:pct:444         232583 Pleadings      10909
    												urn:pct:442         232585 Facta          10912
    												urn:pct:443         232584 Motions        100132
    												-->
                    <proc:param>
                      <xsl:attribute name="name">object-smi</xsl:attribute>
                      <xsl:choose>
                        <xsl:when test="$bpf_from_case_filenum = 'brief'">
                          <xsl:attribute name="value">10912</xsl:attribute>
                        </xsl:when>
                        <xsl:when test="$bpf_from_case_filenum = 'pleading'">
                          <xsl:attribute name="value">10909</xsl:attribute>
                        </xsl:when>
                        <xsl:when test="$bpf_from_case_filenum = 'motion'">
                          <xsl:attribute name="value">100132</xsl:attribute>
                        </xsl:when>
                        <xsl:otherwise>
                          <xsl:attribute name="value">
                            <xsl:value-of select="'unk'"/>
                          </xsl:attribute>
                        </xsl:otherwise>
                      </xsl:choose>
                    </proc:param>
                  </xsl:when>
                  <!-- Awantika:2017-11-14- Added CA01 to the streams for webstar  7044267 -->
                  <xsl:when test="not(@smi) and not(starts-with($streamID, 'UK')) and not(starts-with($streamID , 'HK'))">
                    <proc:param>
                      <xsl:attribute name="name">object-smi</xsl:attribute>
                      <xsl:attribute name="value" select="$smi"/>
                    </proc:param>
                    <xsl:comment>Empty @value created by 'Rosetta_inlineobject-LxAdv-ref.inlineobject.xsl'</xsl:comment>
                  </xsl:when>
                  <xsl:otherwise>
                    <!--  Paul: commented out these params, they are for blobstore.  they should be done via this template in Rosetta_inlineobject-to-LxAdv_figure_ref.inlineobject
         <xsl:template match="inlineobject" name="inlineobjblobstore">
                                        <proc:param>
    	                                    <xsl:attribute name="name">external-or-local</xsl:attribute>
    	                                    <xsl:attribute name="value">external</xsl:attribute>
    	                                </proc:param>
    	                                <proc:param>
    	                                    <xsl:attribute name="name">object-server</xsl:attribute>
    	                                    <xsl:attribute name="value">Blobstore</xsl:attribute>
    	                                </proc:param>
    	                                <proc:param>
    	                                    <xsl:attribute name="name">object-pguid</xsl:attribute>
    	                                    <xsl:attribute name="value">urn:contentitem:</xsl:attribute>
    	                                </proc:param>
    -->
                  </xsl:otherwise>
                </xsl:choose>
              </ref:locator-params>
            </ref:locator>
          </xsl:otherwise>
        </xsl:choose>
        <!-- Awantika: Commented xsl:copy as it was copying the attributes of inlineobject which are not used in target -->
        <!--<xsl:copy-of select="@*[not(name()='attachment' or name()='key')]"/>-->
      </ref:inlineobject>
    </xsl:template>
    Template inlineobject/@mimetype|inlineobject/@attachment|inlineobject/@key | inlineobject/@filename | inlineobject/@typerefinline
    Namespace No namespace
    Match inlineobject/@mimetype|inlineobject/@attachment|inlineobject/@key | inlineobject/@filename | inlineobject/@type
    Mode refinline
    Import precedence 0
    Source
    <xsl:template match="inlineobject/@mimetype|inlineobject/@attachment|inlineobject/@key | inlineobject/@filename | inlineobject/@type" mode="refinline"/>
    Template @*refinline
    Namespace No namespace
    Match @*
    Mode refinline
    Import precedence 0
    Source
    <xsl:template match="@*" mode="refinline">
      <xsl:copy>
        <xsl:value-of select="."/>
      </xsl:copy>
    </xsl:template>
    Template inlineobject[not(@filename=$inlineobjFilesToSuppress or @filename=$inlineobjBoilerplateFiles or parent::blockquote or parent::dispformula )]
    Documentation

    Description

    Instructions [common element]

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    If the inlineobject is a diagram or picture illustrating textual material (e.g. not a minor icon or symbol), inlineobject becomes figure/ref:inlineobject.

    Note: When inlineobject is a child of verbatim then conversion should suppress proc:nl from before and after of figure element in the target. For more clarification see Example: 3.

    Source XML 1: Source @smi present

    
    <p>
        <text> 
            <inlineobject type="image" 
                          smi="98765" 
                          attachment="ln-server" 
                          filename="3S3J-WW80-003F-W39R-00000-00-98765-xmp6.gif" />
        </text>
    </p>
    
                 

    Target XML 1: Source @smi present

    
    <p>
        <text>
            <figure>
                <ref:inlineobject>
                    <ref:locator>
                        <ref:locator-key>
                            <ref:key-name name="object-key"/>
                            <ref:key-value value="3S3J-WW80-003F-W39R-00000-00-98765-xmp6"/>
                        </ref:locator-key>
                        <ref:locator-params>
                            <proc:param name="componentseq" value="1"/>
                            <proc:param name="object-type" value="image"/>
                            <proc:param name="object-smi" value="98765"/>
                        </ref:locator-params>
                        </ref:locator>
                </ref:inlineobject>
            </figure>
        </text>
    </p>
    
                 

    Source XML 2: Source @smi not present

    
    <p>
        <text> 
            <inlineobject type="image" 
                          attachment="ln-server" 
                          filename="sch2.gif" />
        </text>
    </p>
    
                 

    Target XML 2: Source @smi not present

    
    <p>
        <text>
            <figure>
                <ref:inlineobject>
                    <ref:locator>
                        <ref:locator-key>
                            <ref:key-name name="object-key"/>
                            <ref:key-value value="X-Y-sch2"/>   <!-- X and Y are LNI and SMI values obtained from CSSM -->
                        </ref:locator-key>
                    <ref:locator-params>
                        <proc:param name="componentseq" value="1"/>
                        <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                        <proc:param name="object-smi" value=""/>    <!-- This @value assignment is done by conversion program -->
                    </ref:locator-params>
                    </ref:locator>
                </ref:inlineobject>
            </figure>
        </text>
    </p>
    
                 

    Source XML 3: <nl/> before and after <inlineobject>

    <p>
        <text>
            <verbatim verbatimclass="future">
                ...
                <nl/> 26. Each of the provisions of the Act listed in
                Column A of the<nl/> Table to this section is amended in the manner specified for
                the<nl/> provision in Column B of the Table.<nl/>
                <inlineobject filename="SO13_18FT-0001.jpg" type="image" attachment="ln-server"/><nl/>
                <inlineobject filename="SO13_18FT-0002.jpg" type="image" attachment="ln-server"/><nl/>
                <inlineobject filename="SO13_18FT-0003.jpg" type="image" attachment="ln-server"/><nl/>
                SOLICITORS ACT<nl/>
                <nl/> 27. (1) Section 1 of the Solicitors Act is amended by striking<nl/> out "If a
                person, unless a party to the proceeding, commences" at the<nl/> beginning and
                substituting "Subject to subsection (2), if a person<nl/> commences".<nl/>
            </verbatim>
        </text>
    </p>
                 

    Target XML 3: <nl/> before and after <inlineobject>

    <p>
        <text>
            <verbatim verbatimclass="future">
                ...
                <proc:nl/> 26. Each of the provisions of the Act listed in
                Column A of the<proc:nl/> Table to this section is amended in the manner specified for
                the<proc:nl/> provision in Column B of the Table.
                
                <figure>
                    <ref:inlineobject>
                        <ref:locator>
                            <ref:locator-key>
                                <ref:key-name name="object-key"/>
                                <ref:key-value value="X-Y-SO13_18FT-0001"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                            </ref:locator-key>
                            <ref:locator-params>
                                <proc:param name="componentseq" value="1"/>
                                <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                                <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                            </ref:locator-params>
                        </ref:locator>
                    </ref:inlineobject>
                </figure>
                <figure>
                    <ref:inlineobject>
                        <ref:locator>
                            <ref:locator-key>
                                <ref:key-name name="object-key"/>
                                <ref:key-value value="X-Y-SO13_18FT-0002"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                            </ref:locator-key>
                            <ref:locator-params>
                                <proc:param name="componentseq" value="1"/>
                                <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                                <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                            </ref:locator-params>
                        </ref:locator>
                    </ref:inlineobject>
                </figure>
                <figure>
                    <ref:inlineobject>
                        <ref:locator>
                            <ref:locator-key>
                                <ref:key-name name="object-key"/>
                                <ref:key-value value="X-Y-SO13_18FT-0003"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                            </ref:locator-key>
                            <ref:locator-params>
                                <proc:param name="componentseq" value="1"/>
                                <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                                <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                            </ref:locator-params>
                        </ref:locator>
                    </ref:inlineobject>
                </figure>
                SOLICITORS ACT<proc:nl/>
                <proc:nl/> 27. (1) Section 1 of the Solicitors Act is amended by striking<proc:nl/> out "If a
                person, unless a party to the proceeding, commences" at the<proc:nl/> beginning and
                substituting "Subject to subsection (2), if a person<proc:nl/> commences".<proc:nl/>
            </verbatim>
        </text>
    </p>
                 


    Description

     <topicref href="../../common_newest/Rosetta_inlineobject-LxAdv-figure_ref.inlineobject.dita"/> 
     created 2 global parameters to be used in driver, 
            
            <xsl:param name="inlineobjBoilerplateFiles" select="('xxx.gif', 'xxx.png')"/> for boilerplate filenames that ARE
            to be converted to ref:inlineobject.
            
            <xsl:param name="inlineobjFilesToSuppress" select="('yyy.png', 'yyy.gif')"/> for filenames that are to be 
            *SUPPRESSED* from conversion but require special handling elsewhere.  That other handling is not specified in this module
            
        When the @filename attribute of inlineobject is not on either of those lists, we will output the figure wrapper in this module.    
        
        This will allow us to be LBU-specific in names of files for specific handling.
        
        
        JL
        
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_inlineobject-LxAdv-figure_ref.inlineobject.dita  
     <xsl:param name="inlineobjFilesToSuppress"/>
    	<xsl:param name="inlineobjBoilerplateFiles" select="('1.gif', '2.gif', '3.gif', '4.gif', '5.gif', 'IconSignalPositive.gif', 'IconSignalNegative.gif', 'IconSignalNeutral.gif', 'IconSignalPossibleNegative.gif', 'IconSignalCiteInfoOnly.gif', 'cbcc.gif', 'leg1.gif', 'mb.gif', 'au_repealed.gif', 'au_exclaim.gif', '1.png', '2.png', '3.png', '4.png', '5.png', 'IconSignalPositive.png', 'IconSignalNegative.png', 'IconSignalNeutral.png', 'IconSignalPossibleNegative.png', 'IconSignalCiteInfoOnly.png', 'cbcc.png', 'leg1.png', 'mb.png', 'au_repealed.png', 'au_exclaim.png')"/>
    	 
    Namespace No namespace
    Match inlineobject[not(@filename=$inlineobjFilesToSuppress or @filename=$inlineobjBoilerplateFiles or parent::blockquote or parent::dispformula )]
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="inlineobject[not(@filename=$inlineobjFilesToSuppress          or @filename=$inlineobjBoilerplateFiles          or parent::blockquote         or parent::dispformula          )]">
      <!--  Paul: I removed this bodytext parent check from the not() part of the match predicate.  
                It was causing objects to get suppressed.
            "or parent::bodytext"
            FYI:
            parent::blockquote seems to be handled by 	<xsl:template match="blockquote[inlineobject and not(inlinobject/following-sibling::* or inlineobject/preceding-sibling::*)]">
            parent::dispformula is handled by 	<xsl:template match="dispformula">
    -->
      <xsl:variable name="blobstoreStreams" select="('UK01','UK02','UK03', 'UK04', 'UK05', 'UK06', 'UK07', 'UK08CA', 'UK08OR', 'UK09', 'UK10', 'UK11DA', 'UK11DN', 'UK12', 'UK14', 'UK15', 'UK15', 'UK16', 'UK17', 'UK17', 'UK18', 'UK22CF', 'UK22CS','HK01','HK02', 'HK03','HK04','HK05','HK06','HK07','HK08', 'HK09'             )"/>
      <!-- Paul: I removed 2 non-uk streams from the $blobstoreStreams.
                I'm pretty sure people were only doing this to get the "when" behavior below instead of the "otherwise".
                They aren't blobstore streams.  See otherwise clause comment.  I know the otherwise <figure> output is difference from DT but i think that may be incorrect.
                As of 2017-05-27, the ONLY blobstore streams are UK.  No other LBU has moved there yet.
    
                , 'CA19', 'AU04' 
            -->
      <xsl:choose>
        <!-- JL added to handle some UK streams that use blobstore; the test for link parent ensures the output is valid
                    as figure isn't valid in ref:marker
                    -->
        <xsl:when test="$streamID=$blobstoreStreams">
          <!-- JD: 2017-06-08: similar to Paul's note below, UK08CA is adding a <figure> wrapper; 
                    		I assume this is because the overlapping conditions in CCCC-10540 and CCCC-10368), 
                    		including this dubious instruction: 
                    		"If the inlineobject is a diagram or picture illustrating textual material (e.g. not a minor icon or symbol), inlineobject becomes figure/ref:inlineobject."
                    		(how are we or the XSLT processor to know whether the image is a diagram or picture illustrating textual material?)
                    		
                    		For now, hacking with additional xsl:when clause
                    	-->
          <xsl:choose>
            <xsl:when test="parent::h[$streamID='UK09']">
              <xsl:call-template name="inlineobjblobstore"/>
            </xsl:when>
            <xsl:when test="parent::link | parent::figure | parent::emph | parent::publication  and not(parent::emph/parent::h) or (parent::text and $streamID=('UK08CA','UK11DA','UK06'))">
              <xsl:call-template name="inlineobjblobstore"/>
            </xsl:when>
            <!-- JD: 2017-10-31: when ancestor is figure the <figure> element has already been created.  
                            This may be brittle; the source is:
                          <figure>
                            <p>
                               <text>
                                  <inlineobject ...>
                                </text>
                            </p>
                          </figure>
                          -->
            <xsl:when test="$streamID=('UK01','UK08OR') and ancestor::figure">
              <xsl:call-template name="inlineobjblobstore"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:choose>
                <!-- Awantika: Added condition when parent is case:judgements for HK03 -->
                <xsl:when test="$streamID='HK03' and parent::case:judgments">
                  <attachments>
                    <appendix>
                      <bodytext>
                        <figure>
                          <xsl:call-template name="inlineobjblobstore"/>
                        </figure>
                      </bodytext>
                    </appendix>
                  </attachments>
                </xsl:when>
                <xsl:otherwise>
                  <figure>
                    <xsl:call-template name="inlineobjblobstore"/>
                  </figure>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:otherwise>
          <!-- Paul: DT seems to be omitting the figure wrapper.  is this correct? -->
          <xsl:choose>
            <xsl:when test="$streamID = ('AU16') or parent::figure[$streamID= ('AU15' , 'AU05', 'NZ12', 'AU18')] or parent::remotelink[ ( @service = 'URL' or @href ) and not( ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ) ]">
              <xsl:apply-templates select="." mode="refinline"/>
            </xsl:when>
            <!-- 20170607:  MCJ:  Added condition for AU06.  I am not sure why this wouldn't be the default handling (to avoid a figure within a figure) but
                                                  don't want to affect other streams. -->
            <xsl:when test="($streamID = 'AU06') or ($streamID = 'NZ05') or ($streamID='AU19_CC')">
              <xsl:choose>
                <!-- this condition is probably not complete in terms of preventing a double wrapper for 'figure'.  The test for an ancestor figure will
                                         cover most things but could also cause trouble if there are constructs in between the outer wrapper and the current
                                         inline object that need different handling.  This module could use some refactoring (not just for this stream area). -->
                <xsl:when test="(./parent::leg:bodytext or ./parent::li or ./parent::text or ./parent::legfragment) and not(ancestor::figure)">
                  <figure>
                    <xsl:apply-templates select="." mode="refinline"/>
                  </figure>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:apply-templates select="." mode="refinline"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:when>
            <!-- JD: probably more applicable, but setting to AU11 for now.  leg:bodytext/inlineobject would need to create primlaw:bodytext/p/text/figure -->
            <xsl:when test="$streamID='AU11' and parent::leg:bodytext">
              <p>
                <text>
                  <figure>
                    <xsl:apply-templates select="." mode="refinline"/>
                  </figure>
                </text>
              </p>
            </xsl:when>
            <!-- JD: probably more applicable, but settting to NZ18 for now.  Do not create <figure> wrapper when under <lnci:content> -->
            <xsl:when test="$streamID='NZ18' and parent::remotelink/parent::ci:content">
              <xsl:apply-templates select="." mode="refinline"/>
            </xsl:when>
            <xsl:when test="$streamID='AU04' and preceding-sibling::*[1][self::ci:cite]">
              <xsl:apply-templates select="." mode="refinline"/>
            </xsl:when>
            <xsl:when test="parent::figure">
              <xsl:apply-templates select="." mode="refinline"/>
            </xsl:when>
            <!-- Awantika: 2017-12-28- Added when condition for ancestor figure as two wrappers for figure
                            were being created. Webstar # 7080120-->
            <xsl:when test="ancestor::figure and $streamID='AU04'">
              <xsl:apply-templates select="." mode="refinline"/>
            </xsl:when>
            <xsl:otherwise>
              <figure>
                <xsl:apply-templates select="." mode="refinline"/>
              </figure>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template inlineobjectinlineobjblobstore
    Documentation

    Description

     JL Included template name inlineobjblobstore from another module with DITA instructions
        <dita:topic xmlns="http://dita.oasis-open.org/architecture/2005/" id="Rosetta_inlineobject-to-LexisAdvance_ref.inlineobject_BLOBSTORE">
        
    Namespace No namespace
    Match inlineobject
    Mode #default
    Used by
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="inlineobject" name="inlineobjblobstore">
      <xsl:choose>
        <xsl:when test="$streamID=('AU04', 'AU06') and parent::blockquote">
          <p>
            <figure>
              <ref:inlineobject>
                <xsl:apply-templates select="@height | @width"/>
                <ref:locator>
                  <ref:locator-key>
                    <ref:key-name name="object-key"/>
                    <ref:key-value>
                      <xsl:apply-templates select="@filename"/>
                    </ref:key-value>
                  </ref:locator-key>
                  <ref:locator-params>
                    <proc:param name="object-type" value="IMG"/>
                    <proc:param name="external-or-local" value="external"/>
                    <proc:param name="object-server" value="Blobstore"/>
                    <proc:param name="object-pguid" value="urn:contentItem:0000-0000-0000-0000-00000-00"/>
                    <proc:param name="componentseq" value="1"/>
                  </ref:locator-params>
                </ref:locator>
              </ref:inlineobject>
            </figure>
          </p>
        </xsl:when>
        <xsl:otherwise>
          <ref:inlineobject>
            <xsl:apply-templates select="@height | @width"/>
            <ref:locator>
              <ref:locator-key>
                <ref:key-name name="object-key"/>
                <ref:key-value>
                  <xsl:apply-templates select="@filename"/>
                </ref:key-value>
              </ref:locator-key>
              <ref:locator-params>
                <proc:param name="object-type" value="IMG"/>
                <proc:param name="external-or-local" value="external"/>
                <proc:param name="object-server" value="Blobstore"/>
                <proc:param name="object-pguid" value="urn:contentItem:0000-0000-0000-0000-00000-00"/>
                <proc:param name="componentseq" value="1"/>
              </ref:locator-params>
            </ref:locator>
          </ref:inlineobject>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template inlineobject/@height | inlineobject/@width
    Namespace No namespace
    Match inlineobject/@height | inlineobject/@width
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="inlineobject/@height | inlineobject/@width">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template inlineobject/@filename
    Namespace No namespace
    Match inlineobject/@filename
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="inlineobject/@filename">
      <xsl:attribute name="value">
        <xsl:apply-templates select="parent::inlineobject/@dpsi"/>
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template inlineobject/@dpsi
    Namespace No namespace
    Match inlineobject/@dpsi
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="inlineobject/@dpsi">
      <xsl:value-of select="concat('[[DPSI:', . , ']]')"/>
    </xsl:template>
    Template inlineobject[$streamID='CA10']
    Namespace No namespace
    Match inlineobject[$streamID='CA10']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="inlineobject[$streamID='CA10']" priority="25">
      <figure>
        <xsl:apply-templates select="." mode="refinline"/>
      </figure>
    </xsl:template>
    Template inlineobject[@filename='au_repeal01.png'][$streamID='AU04'] | inlineobject[@filename='au_repeal01.gif'][$streamID='AU04']
    Namespace No namespace
    Match inlineobject[@filename='au_repeal01.png'][$streamID='AU04'] | inlineobject[@filename='au_repeal01.gif'][$streamID='AU04']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="inlineobject[@filename='au_repeal01.png'][$streamID='AU04'] | inlineobject[@filename='au_repeal01.gif'][$streamID='AU04']">
      <legisinfo:status statuscode="repealed"/>
    </xsl:template>
    Template nl[following-sibling::*[1][self::inlineobject[@filename!=$inlineobjFilesToSuppress]]][following-sibling::*[2][self::nl]] | nl[preceding-sibling::*[1][self::inlineobject[@filename!=$inlineobjFilesToSuppress]]][following-sibling::*[2][self::nl]]
    Namespace No namespace
    Match nl[following-sibling::*[1][self::inlineobject[@filename!=$inlineobjFilesToSuppress]]][following-sibling::*[2][self::nl]] | nl[preceding-sibling::*[1][self::inlineobject[@filename!=$inlineobjFilesToSuppress]]][following-sibling::*[2][self::nl]]
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="nl[following-sibling::*[1][self::inlineobject[@filename!=$inlineobjFilesToSuppress]]][following-sibling::*[2][self::nl]] | nl[preceding-sibling::*[1][self::inlineobject[@filename!=$inlineobjFilesToSuppress]]][following-sibling::*[2][self::nl]]"/>
    Template h[inlineobject]
    Documentation

    Description

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    h/inlineobject becomes figure/ref:inlineobject. The attributes of h are handled as follows:

    • h/@align becomes figure/@align.

    Source XML showing inlineobject occurring in h

    
    <leg:levelbody>
        <leg:bodytext>
            <h align="center">
                <inlineobject type="image" filename="CTH_ACT_2001-65_PIC030.gif" attachment="ln-server"/>
            </h>
        </leg:bodytext>
    </leg:levelbody>
    
                

    Target XML

    
    <primlaw:bodytext>
        <figure align="center">
            <ref:inlineobject>
                <ref:locator>
                    <ref:locator-key>
                        <ref:key-name name="object-key"/>
                        <ref:key-value value="X-Y-CTH-ACT-2001-65-PIC030"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                    </ref:locator-key>
                    <ref:locator-params>
                        <proc:param name="componentseq" value="1"/>
                        <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                        <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                    </ref:locator-params>
                </ref:locator>
            </ref:inlineobject>
        </figure>
    </primlaw:bodytext>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_inlineobject-Chof-h-LxAdv-figure_ref.inlineobject.dita"/> 
    Namespace No namespace
    Match h[inlineobject]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="h[inlineobject]">
      <!--  Original Target XPath:  figure/ref:inlineobject   -->
      <figure>
        <xsl:apply-templates select="@* | node()"/>
      </figure>
    </xsl:template>
    Template h[inlineobject][$streamID='UK09']
    Namespace No namespace
    Match h[inlineobject][$streamID='UK09']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="h[inlineobject][$streamID='UK09']" priority="25">
      <!--  Original Target XPath:  figure/ref:inlineobject   -->
      <h>
        <xsl:apply-templates select="@* | node()"/>
      </h>
    </xsl:template>
    Template h/@align
    Namespace No namespace
    Match h/@align
    Mode #default
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="h/@align" priority="2">
      <!-- wpk 2017-12-13.  webstar 7067569.
    	        Changed priority to 2.
    	        The base "nonamespace/Rosetta_h-LxAdv-h.xsl" has this identical template.  Ideally it should be removed here so 
    	        as to avoid amiguous match when both are included.
    	        There are streams in which the base module is not used but this module is used.  So we cannot rely on the common exclusively.
    	        In order to ensure no side effects and to avoid ambiguity, the priority is changed to 2.-->
      <xsl:attribute name="align">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template sub[inlineobject]
    Documentation

    Description

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    emph/inlineobject becomes figure/ref:inlineobject.

    Source XML showing inlineobject occurring in emph

    <p>
        <text>
            <emph typestyle="it">
                <inlineobject type="image" filename="SA_ACT_1984-3_PIC2.gif" attachment="ln-server"/>
            </emph>
        </text>
    </p>
                

    Target XML

    <p>
        <text>
            <figure>
                <ref:inlineobject>
                    <ref:locator>
                        <ref:locator-key>
                            <ref:key-name name="object-key"/>
                            <ref:key-value value="X-Y-SA-ACT-1984-3-PIC2"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                        </ref:locator-key>
                        <ref:locator-params>
                            <proc:param name="componentseq" value="1"/>
                            <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                            <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                        </ref:locator-params>
                    </ref:locator>
                </ref:inlineobject>
        </figure>
      </text>  
    </p>
                

    When source is having emph followed by inlineobject inside base:h element h/emph/inlineobjectthan in Target it should Map with and becomes emph/ref:inlineobject.

    <h>
        <emph typestyle="bf">Table 2 Estimation of regression coefficients using the SUR model 
            <inlineobject type="image" mimetype="image/gif" filename="JFRC_2005_Vol13_Issue2_May_167_1.gif" />
        </emph>
    </h>
    
    Becomes
        
     <emph typestyle="bf">Table 2 Estimation of regression coefficients using the SUR model
         <ref:inlineobject>
                    <ref:locator>
                        <ref:locator-key>
                            <ref:key-name name="object-key"/>
                            <ref:key-value value="X-Y-JFRC_2005_Vol13_Issue2_May_167_1"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                        </ref:locator-key>
                        <ref:locator-params>
                            <proc:param name="componentseq" value="1"/>
                            <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                            <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                        </ref:locator-params>
                    </ref:locator>
                </ref:inlineobject>
    </emph>
                

    When source is having emph followed by another emph of same typestyle and then followed by inlineobject sup/emph/emph/inlineobjectthan in Target it should drop one emph and the followed emph/inlineobject should directly Map it with and becomes sup/emph/ref:inlineobject.

    <row>
        <entry>
            <sup>
                <emph typestyle="it">
                    <emph typestyle="it">
                        <inlineobject type="image" mimetype="image/gif" filename="ALE_2014_Vol16_Issue2_Sep_433_1.gif" />
                    </emph>
                </emph>
            </sup>
        </entry>
        <entry>(1)</entry>
    </row>
    
    Becomes
    
    <row>
        <entry>
            <sup>
                <emph>
                    <ref:inlineobject>
                        <ref:locator>
                            <ref:locator-key>
                                <ref:key-name name="object-key"/>
                                <ref:key-value value="X-Y-ALE_2014_Vol16_Issue2_Sep_433_1"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                            </ref:locator-key>
                            <ref:locator-params>
                                <proc:param name="componentseq" value="1"/>
                                <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                                <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                            </ref:locator-params>
                        </ref:locator>
                    </ref:inlineobject>
                </emph>
            </sup>
        </entry>    
    </row>
                

    When source is having leg:comntry/level/bodytext/heading/title/emph/inlineobject then it becomes annot:annotations/annot:annotation-grp/annot:annotation/bodytext/h/emph/ref:inlineobject.

    <leg:comntry searchtype="ANNOTATIONS">
        <level leveltype="comm30">
            <bodytext>
                <heading searchtype="ANNOTATIONS">
                    <title>
                        <emph typestyle="bf">
                            <inlineobject type="image" mimetype="image/gif" filename="img8d4.gif" />NOTES
                        </emph>
                    </title>
                </heading>
            </bodytext>
        </level>
    </leg:comntry>
    
    Becomes
    
    <annot:annotations>
        <annot:annotation-grp grptype="COMMENTARY">
            <annot:annotation>
                <bodytext>
                    <h>
                        <emph typestyle="bf"><ref:inlineobject>
                            <ref:locator>
                                <ref:locator-key>
                                    <ref:key-name name="object-key"/>
                                    <ref:key-value value="X-Y-img8d4"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                                </ref:locator-key>
                                <ref:locator-params>
                                    <proc:param name="componentseq" value="1"/>
                                    <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                                    <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                                </ref:locator-params>
                            </ref:locator>
                        </ref:inlineobject>NOTES</emph>
                    </h>
                </bodytext>
            </annot:annotation>
        </annot:annotation-grp>
    </annot:annotations>
                

    Description

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    sub/inlineobject becomes figure/ref:inlineobject. Suppress sub from conversion.

    Source XML

    
    <text>
        The various language versions of that phrase use the terms
        'adscribirse' (Spanish), 'tages sammen' (Danish), 'angehängt'
        (German), 
        '<sub>
            <inlineobject type="image" mimetype="image/gif"
            filename="img1c4e.gif"/>
        </sub>' 
        (Greek), 'added on'
        (English), 'rattachée' (French), 'collegato' (Italian), 'gevoegd
        bij' (Dutch), 'ligado' (Portuguese), 'yhteydessä' (Finnish) and
        'läggas samman' (Swedish).
    </text>
    
        

    Target XML

    
    <text>
        The various language versions of that phrase use the terms
        'adscribirse' (Spanish), 'tages sammen' (Danish), 'angehängt'
        (German), 
        '<figure>
            <ref:inlineobject>
                <ref:locator>
                    <ref:locator-key>
                        <ref:key-name name="object-key"/>
                        <ref:key-value value="X-Y-img1c4e"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                    </ref:locator-key>
                    <ref:locator-params>
                        <proc:param name="componentseq" value="1"/>
                        <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                        <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                    </ref:locator-params>
                </ref:locator>
            </ref:inlineobject>
        </figure>' 
        (Greek), 'added on'
        (English), 'rattachée' (French), 'collegato' (Italian), 'gevoegd
        bij' (Dutch), 'ligado' (Portuguese), 'yhteydessä' (Finnish) and
        'läggas samman' (Swedish).
    </text>
    
        

    Description

     <topicref href="../../common_newest/Rosetta_inlineobject-Chof-emph-LxAdv-figure_ref.inlinobject.dita"/> 
     ********************** 
     Use '/nonamespace/Rosetta_emph-LxAdv-emph.xsl' instead 
     ********************** 
    <xsl:template match="emph/inlineobject">
    
    		<!-\-  Original Target XPath:  figure/ref:inlineobject   -\->
    	    <figure xmlns="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
    			<ref:inlineobject>
    				<xsl:apply-templates select="@* | node()"/>
    			</ref:inlineobject>
    		</figure>
    
    	</xsl:template>
     <topicref href="../../common_newest/Rosetta_inlineobject-Chof-sub-LxAdv-figure_ref.inlineobject.dita"/> 
    Namespace No namespace
    Match sub[inlineobject]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sub[inlineobject]">
      <!--  Original Target XPath:  figure/ref:inlineobject   -->
      <xsl:apply-templates select="node()"/>
    </xsl:template>
    Template inlineobject[parent::dispformula]
    Documentation

    Description

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    dispformula/inlineobject becomes formula/ref:inlineobject.

    Source XML showing inlineobject occurring in dispformula

    
    <p>
        <text>
            <dispformula>
                <inlineobject type="image" attachment="ln-server" filename="g0146031.gif"/>
            </dispformula>
        </text>
    </p>
    
                

    Target XML

    
    <p>
        <text>
            <formula>
                <ref:inlineobject>
                    <ref:locator>
                        <ref:locator-key>
                            <ref:key-name name="object-key"/>
                            <ref:key-value value="X-Y-g0146031"/>   <!-- X and Y are LNI and SMI values obtained from CSSM -->
                        </ref:locator-key>
                        <ref:locator-params>
                            <proc:param name="componentseq" value="1"/>
                            <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                            <proc:param name="object-smi" value=""/>    <!-- This @value assignment is done by conversion program -->
                        </ref:locator-params>
                    </ref:locator>
                </ref:inlineobject>
            </formula>
        </text>
    </p>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_inlineobject-Chof-dispformula-LxAdv-formula_ref.inlineobject.dita"/> 
    Namespace No namespace
    Match inlineobject[parent::dispformula]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="inlineobject[parent::dispformula]">
      <!--  Original Target XPath:  formula/ref:inlineobject   -->
      <xsl:apply-templates select="." mode="refinline"/>
    </xsl:template>
    Template blockquote[inlineobject and not(inlinobject/following-sibling::node() or inlineobject/preceding-sibling::node())]
    Documentation

    Description

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    p/blockquote/inlineobject becomes p/figure/ref:inlineobject.

    Note: If inlineobject in this context contains sibling elements (other children of blockquote), do not complete this instruction. Instead, complete Rosetta_inlineobject-w-siblings-Chof-p_blockquote-LxAdv-p_figure_ref.inlineobject.dita#Rosetta_inlineobject-w-siblings-Chof-p_blockquote-LxAdv-p_figure_ref.inlineobject

    Source XML showing inlineobject occurring in blockquote

    
    <leg:levelbody>
        <leg:bodytext>
            <p>
                <text>The value of ...</text>
                <blockquote>
                    <inlineobject type="image" filename="TAS_ACT_1987-13_HIGH-PENAM07.tiff" attachment="ln-server"/>
                </blockquote>
                <text>where&#160;&ndash;</text>
            </p>
        </leg:bodytext>
    </leg:levelbody>
    
                

    Target XML showing inlineobject occurring in blockquote

    
    <primlaw:bodytext>
        <p>
            <text>The value of ...</text>
            <figure>
                <ref:inlineobject>
                    <ref:locator>
                        <ref:locator-key>
                            <ref:key-name name="object-key"/>
                            <ref:key-value value="X-Y-TAS-ACT-1987-13-HIGH-PENAM07"/> <!-- X and Y are LNI and SMI values obtained from CSSM -->
                        </ref:locator-key>
                        <ref:locator-params>
                            <proc:param name="componentseq" value="1"/>
                            <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp, .tiff)-->
                            <proc:param name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
                        </ref:locator-params>
                    </ref:locator>
                </ref:inlineobject>
            </figure>
        </p>
    </primlaw:bodytext>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_inlineobject-Chof-p_blockquote-LxAdv-p_figure_ref.inlineobject.dita"/> 
    Namespace No namespace
    Match blockquote[inlineobject and not(inlinobject/following-sibling::node() or inlineobject/preceding-sibling::node())]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="blockquote[inlineobject and not(inlinobject/following-sibling::node() or inlineobject/preceding-sibling::node())]">
      <!--  Original Target XPath:  p/figure/ref:inlineobject   -->
      <p>
        <figure>
          <ref:inlineobject>
            <xsl:apply-templates select="inlineobject" mode="refinline"/>
          </ref:inlineobject>
        </figure>
      </p>
    </xsl:template>
    Template p/blockquote[inlineobject and not(inlinobject/following-sibling::node() or inlineobject/preceding-sibling::node())]
    Documentation

    Description

     Template specific to p/blockquote so a new p wrapper is not created... a better way probably exists to do this. 
    Namespace No namespace
    Match p/blockquote[inlineobject and not(inlinobject/following-sibling::node() or inlineobject/preceding-sibling::node())]
    Mode #default
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="p/blockquote[inlineobject and not(inlinobject/following-sibling::node() or inlineobject/preceding-sibling::node())]" priority="25">
      <!--  Original Target XPath:  p/figure/ref:inlineobject   -->
      <figure>
        <xsl:apply-templates select="." mode="refinline"/>
      </figure>
    </xsl:template>
    Template inlineobject[parent::bodytext]
    Documentation

    Description

    Instructions

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    bodytext/inlineobject becomes bodytext/p/text/figure/ref:inlineobject.

    Source XML

    
    <bodytext>
        <inlineobject type="image" attachment="ln-server" filename="elb31.gif"/>
        <p>
            <text>The European Court of Justice also found that contracting out arrangements could fall under the Directive...</text>
        </p>
        ...
    </bodytext>
    
        

    Target XML

    
    <bodytext>
            <p>
                <text>
                    <figure>
                        <ref:inlineobject>
                            <ref:locator>
                                <ref:locator-key>
                                    <ref:key-name name="object-key"/>
                                    <ref:key-value value="X-Y-elb31"/>  <!-- X and Y are LNI and SMI values obtained from CSSM -->
                                </ref:locator-key>
                                <ref:locator-params>
                                    <proc:param name="componentseq" value="1"/>
                                    <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                                    <proc:param name="object-smi" value=""/>        <!-- This @value assignment is done by conversion program -->                                
                                </ref:locator-params>
                            </ref:locator>
                        </ref:inlineobject>
                    </figure>
                </text>
            </p>
            <p>
                <text>The European Court of Justice also found that contracting out arrangements could fall under the Directive...</text>
            </p>
            ...
    </bodytext>
    
        

    Description

     <topicref href="../../common_newest/Rosetta_inlineobject-Chof-bodytext-LxAdv-bodytext_p_text_figure_ref.inlineobject.dita"/> 
    Namespace No namespace
    Match inlineobject[parent::bodytext]
    Mode #default
    Import precedence 0
    Source
    <xsl:template xmlns="http://dita.oasis-open.org/architecture/2005/" match="inlineobject[parent::bodytext]">
      <xsl:element name="p">
        <xsl:element name="text">
          <xsl:element name="figure">
            <xsl:apply-templates select="." mode="refinline"/>
          </xsl:element>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template insert-line[@character and not(parent::blockquote)]
    Documentation

    Description

    Instructions [common element]

    insert-line[@character] becomes proc:nl.

    Source XML : If insert-line/@character=" " comes in XPATH bodytext/blockquote/insert-line

     <blockquote> <insert-line character=" "/>
    					</blockquote> 

    Target XML : If insert-line/@character=" " comes in XPATH bodytext/blockquote/insert-line

     <p/> 

    Source XML : If insert-line/@character="" comes in XPATH bodytext/blockquote/insert-line

     <blockquote> <insert-line character=""/>
    					</blockquote> 

    Target XML : If insert-line/@character="" comes in XPATH bodytext/blockquote/insert-line

     <p/> 

    Note: When insert-line occurs as a child of a blockquote and the character type is space, nbsp, or thinsp, then the result is mapped to an empty p tag.

    Source XML

     <leg:bodytext> <p> <blockquote>
    					<insert-line character=" "/> <p
    					indent="none"><text>Tape reference: <form-chars
    					character="." num-char="16"/></text></p> <p
    					indent="none"><text><form-chars character="."
    					num-char="16"/></text></p> <p
    					indent="none"><text>Name of complainant: <form-chars
    					character="." num-char="16"/></text></p> <p
    					indent="none"><text>Cross reference to other interviews with
    					complainant: <form-chars character="."
    					num-char="16"/></text></p> <insert-line character="
    					"/> <p indent="none"><text>I certify that the contents
    					of this certificate are correct.</text></p>
    					<insert-line character=" "/> <p
    					indent="none"><text><form-chars character="."
    					num-char="12"/></text></p> <p
    					indent="none"><text align="center">Signature of
    					Interviewer<form-chars character=" "
    					num-char="16"/><form-chars character=" "
    					num-char="2"/></text></p> <insert-line character="
    					"/> <p indent="none"><text align="center">Date of
    					Certificate<form-chars character=" "
    					num-char="16"/><form-chars character=" "
    					num-char="2"/></text></p> </blockquote>
    					</p> </leg:bodytext> 

    Target XML

     <primlaw:bodytext> <p> <blockquote>
    					<p/> <p indent="none"><text>Tape reference:
    					<proc:formchars formchar="dot"
    					formcharuse="longname"/></text></p> <p
    					indent="none"><text><proc:formchars formchar="dot"
    					formcharuse="longname"/></text></p> <p
    					indent="none"><text>Name of complainant: <proc:formchars
    					formchar="dot" formcharuse="longname"/></text></p>
    					<p indent="none"><text>Cross reference to other interviews
    					with complainant: <proc:formchars formchar="dot"
    					formcharuse="longname"/></text></p> <p/> <p
    					indent="none"><text>I certify that the contents of this
    					certificate are correct.</text></p> <p/> <p
    					indent="none"><text><proc:formchars formchar="dot"
    					formcharuse="address"/></text></p> <p
    					indent="none"><text align="center">Signature of
    					Interviewer<proc:formchars formchar="dot"
    					formcharuse="longname"/><proc:formchars formchar="dot"
    					formcharuse="day"/></text></p> <p/> <p
    					indent="none"><text align="center">Date of
    					Certificate<proc:formchars formchar="dot"
    					formcharuse="longname"/><proc:formchars formchar="dot"
    					formcharuse="day"/></text></p> </blockquote>
    					</p> </primlaw:bodytext> 

    Description

    topicref href="AU01_Rosetta_inlineobject-Chof-ci.conent_remotelink-LxAdv-lnci.content_ref.crossreference.dita"/
     <topicref href="../../common_newest/Rosetta_AU_commentary_inlineobject-Chof-ci.conent_remotelink-LxAdv-lnci.content_ref.crossreference.dita"/> 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    <xsl:include
    		href="../../modules/nonamespace/Rosetta_AU_commentary_inlineobject-Chof-ci.conent_remotelink-LxAdv-lnci.content_ref.crossreference.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     end topichead  inlineobject  
     rosetta element: insert-line 
     <topicref href="../../common_newest/Rosetta_insert-line-LxAdv-proc.nl.dita"/> 
     MCJ:  2017-08-01: updated predicate to test for not(parent::blockquote) in order to remove ambiguity with other template.
        	                   this introduces new holes that will need to be refactored if/when relevant data appears.  My guess is that
        	                   these templates need to be consolidated so that the transform to proc:nl is the default and the test on
        	                   parent::blockquote (and testing @character) becomes exceptions. 
     JD: 2017-07-25: modified per instruction "insert-line[@character] becomes proc:nl." 
    xsl:template match="insert-line"
    Namespace No namespace
    Match insert-line[@character and not(parent::blockquote)]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="insert-line[@character and not(parent::blockquote)]">
      <!--  Original Target XPath:  proc:nl   -->
      <proc:nl>
        <xsl:apply-templates select="@* | node()"/>
      </proc:nl>
    </xsl:template>
    Template insert-line[parent::blockquote and @character = (' ', ' ', ' ')]
    Documentation

    Description

     JD: 2017-07-25: modified below to test unicode value of character, as contains() won't work on character entities 
    xsl:template match="insert-line[parent::blockquote and (@character=' ' or contains(@character,'nbsp') or contains(@character, 'thinsp'))]"
    Namespace No namespace
    Match insert-line[parent::blockquote and @character = (' ', ' ', ' ')]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="insert-line[parent::blockquote and @character = (' ', ' ', ' ')]">
      <xsl:choose>
        <xsl:when test="parent::blockquote[parent::p][not(child::*[2])]">
          <text>
            <proc:nl/>
          </text>
        </xsl:when>
        <xsl:otherwise>
          <p/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template insert-line[parent::blockquote[parent::bodytext[parent::level[@leveltype=('prec.grp' , 'precgrp' , 'precgrp1' , 'precgrp2' , 'prec' , 'form')]]] and @character = (' ', ' ', ' ')][$streamID=('AU05', 'NZ09')]
    Namespace No namespace
    Match insert-line[parent::blockquote[parent::bodytext[parent::level[@leveltype=('prec.grp' , 'precgrp' , 'precgrp1' , 'precgrp2' , 'prec' , 'form')]]] and @character = (' ', ' ', ' ')][$streamID=('AU05', 'NZ09')]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="insert-line[parent::blockquote[parent::bodytext[parent::level[@leveltype=('prec.grp' , 'precgrp' , 'precgrp1' , 'precgrp2' , 'prec' , 'form')]]] and @character = (' ', ' ', ' ')][$streamID=('AU05', 'NZ09')]" priority="2">
      <form:p/>
    </xsl:template>
    Template l[not(@virtual-nesting)]
    Documentation

    Description

    Instructions [common element]

    l becomes list.

    The child li becomes listitem. bodytext is the required child element for listitem. The child lilabel becomes label.

    Any h children of the li should be processed as h within the listitem/bodytext. Process the children of h.

    Nested lists, when a li contains a l element, the mapping should appear as follows: create list/listitem/bodytext followed by a list within the bodytext element.

    Source XML

    
    <l>
      <li>
       <lilabel>
    	   <emph typestyle="ro">(1)</emph>
       </lilabel>
       <p>
    	 <text>The plaintiffs&#x2019; application is dismissed.</text>
       </p>
     </li>
     <li>
       <lilabel>
    	   <emph typestyle="ro">(2)</emph>
       </lilabel>
       <p>
    	 <text>The plaintiffs pay the defendant&#x2019;s costs, including each appearance in the court, as taxed, if not agreed.</text>
       </p>
     </li>
    </l>
    
    	

    Target XML

    
    <list>
     <listitem>
    	<label>
    	  <emph typestyle="ro">(1)</emph>
    	</label>
    	<bodytext>
    	 <p>
    	  <text>The plaintiffs&#x2019; application is dismissed.</text>
    	 </p>
    	</bodytext> 
     </listitem>
     <listitem>
    	<label>
    	  <emph typestyle="ro">(2)</emph>
    	</label>
    	<bodytext>
    	 <p>
    	  <text>The plaintiffs pay the defendant&#x2019;s costs, including each appearance in the court, as taxed, if not agreed.</text>
    	 </p>
    	</bodytext> 
     </listitem>
    </list>
    
    	

    Nested list Source(l/li/l)

        
                  <l>
                <li>
                  <lilabel>&#x2022;</lilabel>
                  <p>
                    <text>the health and safety of workers who are:</text>
                  </p>
                </li>
                <li>
                  <l>
                    <li>
                      <lilabel>&#x25E6;</lilabel>
                      <p>
                        <text>engaged by the person conducting the business or undertaking;</text>
                      </p>
                    </li>
                  </l>
                </li>
                ...  
                
      

    Nested list Target (list/listitem/bodytext/list)

        
              <list>
                <listitem>
                  <label>&#x2022;</label>
                  <bodytext>
                  <p>
                    <text>the health and safety of workers who are:</text>
                  </p>
                  </bodytext>
                </listitem>
                <listitem>
                   <bodytext>
                     <list>
                       <listitem>
                          <label>&#x25E6;</label>
                          <bodytext>
                            <p>
                             <text>engaged by the person conducting the business or undertaking;</text>
                            </p>
                          </bodytext>  
                       </listitem>
                     </list>
                   </bodytext>  
                </listitem>  
                ...
      
      

    Description

     start topichead  l  
     <topicref href="../../common_newest/Rosetta_l-LxAdv-list.dita"/> 
     Done as part of ROCKET but not for any particular stream JL 2017-03-14 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_l-LxAdv-list.dita  
     virtual nesting requires its own template 
    Namespace No namespace
    Match l[not(@virtual-nesting)]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="l[not(@virtual-nesting)]">
      <xsl:choose>
        <!-- Awantika: specific for AU20 -->
        <xsl:when test="$streamID='AU20' and ancestor::source_cttr:annotations[@id='OI7' or @id='OP3']/heading/note/l">
          <xsl:for-each select="li/p/text">
            <primlaw:subordinatelaw-item>
              <textitem>
                <xsl:apply-templates select="@* | node()"/>
              </textitem>
            </primlaw:subordinatelaw-item>
          </xsl:for-each>
        </xsl:when>
        <!-- 2017-10-17 - MDS: Added due to Webstar 7025682 -->
        <xsl:when test="parent::l">
          <xsl:apply-templates select="node()"/>
        </xsl:when>
        <xsl:otherwise>
          <!-- 2017-10-17 - MDS: Removed 'except l' because it was dropping content as found in Webstar 7025682.  See when statement 'parent::l'-->
          <xsl:element name="list">
            <xsl:apply-templates select="@*"/>
            <xsl:if test="$streamID='UK09' and note[not(preceding-sibling::li)]">
              <listitem>
                <bodytext/>
              </listitem>
            </xsl:if>
            <xsl:apply-templates select="node()"/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template l[ancestor::frm:body][not(ancestor::footnote or ancestor::note)][$streamID='UK12']
    Namespace No namespace
    Match l[ancestor::frm:body][not(ancestor::footnote or ancestor::note)][$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="l[ancestor::frm:body][not(ancestor::footnote or ancestor::note)][$streamID='UK12']" priority="25">
      <form:list>
        <xsl:apply-templates select="@*|node() except l"/>
      </form:list>
    </xsl:template>
    Template li[$streamID='UK06' or $streamID='USLPA']
    Documentation

    Description

     Sudhanshu added this template as li and h element is not handled , so added for UK06. 
     JD: 2017-07-10: this should be the default, not stream-specific; appears duplicate of /modules/nonamespace/Rosetta_li-LxAdv-listitem.xsl 
    Namespace No namespace
    Match li[$streamID='UK06' or $streamID='USLPA']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="li[$streamID='UK06' or $streamID='USLPA']">
      <listitem>
        <xsl:apply-templates select="lilabel"/>
        <bodytext>
          <xsl:apply-templates select="h"/>
          <xsl:apply-templates select="@* | node() except (lilabel|h)"/>
        </bodytext>
      </listitem>
    </xsl:template>
    Template lilabel
    Documentation

    Description

     JD: 2017-07-10: this should be the default, not stream-specific 
    <xsl:template match="h[$streamID='UK06']">
        <h>
          <xsl:apply-templates select="@*|node()"/>
        </h>
      </xsl:template>
      <xsl:template match="h/@l[$streamID='UK06']"/>
     
        ********************************************************************************************
        NOTE!
        from  /XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_refpt-LxAdv-ref.anchor.xsl
       
        this is **GENERIC** behavior. If your stream implements differently, fork template or give a streamID test
       
        <p>If <sourcexml>refpt</sourcexml> comes within <sourcexml>l/li/lilabel</sourcexml>
    					then <targetxml>ref:anchor</targetxml> will become the first child of
    						<targetxml>listitem</targetxml>.</p>
    					-	JL
        ************************************************************************************************  
    Namespace No namespace
    Match lilabel
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="lilabel">
      <xsl:choose>
        <!-- SS: Only for HK07 - Remove EMPTY label element inside list-->
        <!-- Awantika: Corrected dropping of lilabel -->
        <!-- JD: 2017-07-24: added NZ18 to streams to suppress empty <label> from; added 'replace' test to get rid of characters not handled by normalize-space(e.g., nbsp) -->
        <xsl:when test="$streamID=('HK07','NZ18', 'AU16', 'NZ12','CA14', 'AU18') and normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = ''">
          <!--<xsl:if test=".[normalize-space() = '']"/>-->
        </xsl:when>
        <xsl:when test="$streamID=('NZ13', 'AU18') and normalize-space(replace(., '^ $', '')) = ''"/>
        <xsl:otherwise>
          <xsl:element name="label">
            <xsl:apply-templates select="@* | node() except(refpt)"/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template l[not(@virtual-nesting)][parent::case:factsummary or parent::case:decisionsummary]
    Documentation

    Description

     Awantika: wrapper p to be created around list if coming in case:factsummary and case:decisionsummary for HK03 
    Namespace No namespace
    Match l[not(@virtual-nesting)][parent::case:factsummary or parent::case:decisionsummary]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="l[not(@virtual-nesting)][parent::case:factsummary or parent::case:decisionsummary]" priority="25">
      <!-- JD: 2017-06-16: removing $streamID test, as this is supposed to be the default handling.  
      	If stream-specific handling is required this should be moved to a stream-specific module. -->
      <!--<xsl:if test="$streamID='HK03'">-->
      <xsl:choose>
        <xsl:when test="$streamID=('NZ04', 'AU13')">
          <list>
            <xsl:apply-templates select="@* | node()"/>
          </list>
        </xsl:when>
        <!-- JD: UK02 wraps in list when a child of case:decisionsummary but not case:factsummary -->
        <xsl:when test="$streamID=('UK02') and parent::case:decisionsummary">
          <list>
            <xsl:apply-templates select="@* | node()"/>
          </list>
        </xsl:when>
        <xsl:otherwise>
          <p>
            <list>
              <xsl:apply-templates select="@* | node()"/>
            </list>
          </p>
        </xsl:otherwise>
      </xsl:choose>
      <!--</xsl:if>-->
    </xsl:template>
    Template lilabel[matches(.,'^$') and not(child::*)]
    Documentation

    Description

     Vikas Rohilla : Added template for the empty lilabel   
     SP : don't apply this rule if child elements exist   
    Namespace No namespace
    Match lilabel[matches(.,'^$') and not(child::*)]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lilabel[matches(.,'^$') and not(child::*)]"/>
    Template l/@type
    Documentation

    Description

     MDS 207-05-17 - Exception found in AU04 There is no target attribute in <list> for l/@type 
    Namespace No namespace
    Match l/@type
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="l/@type"/>
    Template lilabel/fnr
    Documentation

    Description

    lilabel/fnr becomes label/footnote

    Source XML having lilabel/fnr:

             <li id="AFL.FL.FLA75.S31.1.C">    
                 <lilabel>        
                     <refpt id="AFL.FL.FLA75.S31.1.C" type="ext"/>        
                     <fnr fnrtoken="AFL.FL.FLA75.S31.1.C.FTN1-R" fntoken="AFL.FL.FLA75.S31.1.C.FTN1">*</fnr>(c)        
                 </lilabel>    
                 . . .     
             </li> 
         

    Target XML

    
    <listitem>
        <ref: anchor id=" AFL.FL.FLA75.S31.1.C " anchortype="global"/>
        <bodytext>
            ...
        </bodytext>
        <label>(c)
            <footnote>
                <ref:anchor id="AFL.FL.FLA75.S31.1.C.FTN1" anchortype="global"/>
                <label>*</label>
                <bodytext>
                    ....
                </bodytext>
            </footnote>
        </label>
    </listitem>
    
    

    Description

     <topicref href="../../common_newest/Rosetta_fnr-Chof-lilabel-LxAdv-label_footnote.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_fnr-Chof-lilabel-LxAdv-label_footnote.dita  
     Vikas Rohilla : initila updated may by changed if required
     20170531:  MCJ:  Enforced order of processing attributes since some create elements. 
    Namespace No namespace
    Match lilabel/fnr
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="lilabel/fnr">
      <footnote>
        <xsl:choose>
          <xsl:when test="$streamID='AU18'">
            <xsl:element name="ref:anchor">
              <xsl:attribute name="id">
                <xsl:value-of select="@fnrtoken"/>
              </xsl:attribute>
              <xsl:attribute name="anchortype">
                <xsl:text>global</xsl:text>
              </xsl:attribute>
            </xsl:element>
            <label>
              <xsl:apply-templates select="node()"/>
            </label>
            <bodytext>
              <xsl:text><!--Mandatory element per the target schema-->
              </xsl:text>
            </bodytext>
          </xsl:when>
          <xsl:otherwise>
            <!-- Process all attributes except @fnrtoken because fnrtoken produces an element.  This does assume that no other
    		         attributes produce elements. -->
            <xsl:apply-templates select="@* except @fnrtoken"/>
            <!-- Now process @fnrtoken as the last attribute since it produces an element. -->
            <xsl:apply-templates select="@fnrtoken"/>
            <xsl:apply-templates select="node()"/>
          </xsl:otherwise>
        </xsl:choose>
      </footnote>
    </xsl:template>
    Template li
    Documentation

    Description

    When li has attribute @level then conversion need to suppress @level.

    When li is immediately followed by a l that list should be brought into the end of the listitem/bodytext.

    Source XML having li/@level

    
    <l>
        <li level="1">
            <lilabel>(a)</lilabel>
                <p>
                    <text>the day on which the person with the claim first knew,</text>
                </p>
        </li>
    </l>
    
    	

    Target XML

    
    <list>
        <listitem>
            <label>(a)</label>
            <bodytext>
                <p>
                    <text>the day on which the person with the claim first
                        knew,</text>
                </p>
            </bodytext>
        </listitem>
    </list>
    
            

    Description

     <topicref href="../../common_newest/Rosetta_li-LxAdv-listitem.dita"/> 
    Namespace No namespace
    Match li
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="li">
      <!--  Original Target XPath:  listitem   -->
      <listitem>
        <xsl:choose>
          <xsl:when test="@id = ''"/>
          <xsl:when test="$streamID='AU18' and ./@id = descendant::refpt/@id"/>
          <xsl:otherwise>
            <xsl:apply-templates select="@id"/>
          </xsl:otherwise>
        </xsl:choose>
        <xsl:apply-templates select="@* except @id"/>
        <xsl:apply-templates select="lilabel/refpt"/>
        <xsl:apply-templates select="lilabel"/>
        <bodytext>
          <!-- 
                    <xsl:apply-templates select="* except lilabel"/>
    -->
          <xsl:choose>
            <xsl:when test="$streamID=('AU10','NZ11')">
              <!-- WPK 2017-12-08.  In pacific PG, glp:notes can become margin notes.
                                However they are not done by creating new <p><text><marginnote> for each note.
                                The margin notes are all placed inside the preceding <p><text> (already created text node).
                                This is achieved by applying following-sibling glp:note from within the first p/text.
                                Since the following sibling is done there, applying templates here will create duplicates.
                                So this "when" clause prevents duplication of margin notes.
                                4.2.2.3. heading (id-CCCC-10182)
                                1. bodytext/glp:note[notetype="xref"] becomes seclaw:bodytext/p/text/marginnote. New p and text elements are not created;
                                instead, the newly created marginnote is placed in the p that was mapped from the preceding sibling p of glp:note[notetype="xref"]. Within
                                this p the marginnote is placed within the text element that was mapped from the preceding sibling p element's last existing child text element.
                                2. li/glp:note[notetype="xref"] becomes listitem/bodytext/p/text/marginnote. Within the listitem/bodytext, new p
                                and text elements are usually not created; instead, the newly created marginnote is placed in the p that was mapped from the preceding sibling p of
                                glp:note[notetype="xref"]. Within this p the marginnote is placed within the text element that was mapped from the preceding sibling p
                                element's last child text source element. A new text element will need to be created if and only if the glp:note[notetype="xref"] occurs in
                                an li before any sibling p in the li (because in this case there would be no li/p that precedes the li/glp:note).
                            -->
              <xsl:apply-templates select="* except (lilabel | glp:note[@notetype='xref'][preceding-sibling::*[1][self::p[text[not(*) and normalize-space(.)!='']] or self::glp:note[@notetype='xref']]])"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:apply-templates select="* except lilabel"/>
            </xsl:otherwise>
          </xsl:choose>
          <xsl:if test="following-sibling::*[1][self::l]">
            <xsl:apply-templates select="following-sibling::*[1][self::l]" mode="nested-list"/>
          </xsl:if>
        </bodytext>
      </listitem>
    </xsl:template>
    Template lnested-list
    Documentation

    Description

     JL: change to handle potential multiple nested consecutive lists between lis 
    Namespace No namespace
    Match l
    Mode nested-list
    Import precedence 0
    Source
    <xsl:template match="l" mode="nested-list">
      <xsl:choose>
        <xsl:when test="ancestor::frm:body and not(ancestor::footnote or ancestor::note)">
          <form:list>
            <xsl:apply-templates/>
          </form:list>
        </xsl:when>
        <xsl:otherwise>
          <list>
            <xsl:apply-templates/>
          </list>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:if test="following-sibling::*[1][self::l]">
        <xsl:apply-templates select="following-sibling::*[1][self::l]" mode="nested-list"/>
      </xsl:if>
    </xsl:template>
    Template li[ancestor::frm:body][not(ancestor::footnote or ancestor::note)]
    Namespace No namespace
    Match li[ancestor::frm:body][not(ancestor::footnote or ancestor::note)]
    Mode #default
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="li[ancestor::frm:body][not(ancestor::footnote or ancestor::note)]" priority="25">
      <!--  Original Target XPath:  listitem   -->
      <form:listitem>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="lilabel/refpt"/>
        <xsl:apply-templates select="lilabel"/>
        <form:bodytext>
          <xsl:apply-templates select="* except lilabel"/>
          <xsl:if test="following-sibling::*[1][self::l]">
            <xsl:apply-templates select="following-sibling::*[1][self::l]" mode="nested-list"/>
          </xsl:if>
        </form:bodytext>
      </form:listitem>
    </xsl:template>
    Template li/@level
    Namespace No namespace
    Match li/@level
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="li/@level"/>
    Template l[not(@virtual-nesting)][child::glp:note]
    Documentation

    Description

    When l has 2 or more consecutive glp:note children, they should be mapped to a single note child of list. The content of each glp:note should be placed inside note/bodytext.

    Source XML 4 - Multiple Consecutive glp:note Children of l

    
    <l>
        ...
        <li>
            <lilabel>&#x2022;</lilabel>
            <p>
                <text>Estoppel &#x2013; if the true owner induces another to believe in a state of affairs and causes that other person to act on that
                    belief to his or her detriment, the true owner will not be allowed to deny that the state of affairs exists. In the context of sale of
                    goods, this means that if the true owner knowingly allows a seller to represent to a buyer that the seller has title to the goods and
                    the buyer, believing the representation, purchases the goods from the seller, the buyer will get title to the goods as against the
                    true owner. If the true owner owes the buyer a duty of care to the buyer to make the true owner&#x2019;s title to the goods known or
                    apparent to the buyer, but breaches that duty and the buyer purchases the goods from a seller who in fact has no title, the true owner
                    might be estopped by negligence from asserting that ownership. Proving the existence of the duty is usually very difficult.</text>
            </p>
        </li>
        <glp:note notetype="xref">
            <p nl="0">
                <text><emph typestyle="it">Big Rock Pty Ltd v Esanda Finance Corp Ltd </emph>10 WAR 259</text>
            </p>
        </glp:note>
        <glp:note notetype="xref">
            <p nl="0">
                <text><emph typestyle="it">Thomas Australia Wholesale Vehicle Trading Co Pty Ltd v Marac Finance Australia Ltd </emph>(1985) 3 NSWLR
                    452</text>
            </p>
        </glp:note>
    </l>
    
                

    Target XML 4

    
    <list>
        ...
        <listitem>
            <label>&#x2022;</label>
            <bodytext>
                <p>
                    <text>Estoppel &#x2013; if the true owner induces another to believe in a state of affairs and causes that
                        other person to act on that belief to his or her detriment, the true owner will not be allowed to deny
                        that the state of affairs exists. In the context of sale of goods, this means that if the true owner
                        knowingly allows a seller to represent to a buyer that the seller has title to the goods and the buyer,
                        believing the representation, purchases the goods from the seller, the buyer will get title to the goods
                        as against the true owner. If the true owner owes the buyer a duty of care to the buyer to make the true
                        owner&#x2019;s title to the goods known or apparent to the buyer, but breaches that duty and the buyer
                        purchases the goods from a seller who in fact has no title, the true owner might be estopped by negligence
                        from asserting that ownership. Proving the existence of the duty is usually very difficult.</text>
                </p>
            </bodytext>
        </listitem>
        <note notetype="xref">
            <bodytext>
                <p>
                    <text><emph typestyle="it">Big Rock Pty Ltd v Esanda Finance Corp Ltd </emph>10 WAR 259</text>
                </p>
                <p>
                    <text><emph typestyle="it">Thomas Australia Wholesale Vehicle Trading Co Pty Ltd v Marac Finance Australia Ltd
                    </emph>(1985) 3 NSWLR 452</text>
                </p>
            </bodytext>
        </note>
    </list>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_glp.note-Chof-li-LxAdv-listitem-note.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_glp.note-Chof-li-LxAdv-listitem-note.dita  
     JL STILL TESTING IT'S BUGGY THERE'S AN XSPEC FOR YOU TO USE  CAN'T GET @notetype to work yet 
    Namespace No namespace
    Match l[not(@virtual-nesting)][child::glp:note]
    Mode #default
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="l[not(@virtual-nesting)][child::glp:note]" priority="25">
      <list>
        <xsl:for-each-group select="*" group-adjacent="if (self::glp:note) then 0 else 1">
          <xsl:choose>
            <xsl:when test="current-grouping-key()=0">
              <note>
                <xsl:copy-of select="current-group()[1]/@notetype"/>
                <xsl:apply-templates select="current-group()/refpt"/>
                <xsl:apply-templates select="current-group()/heading"/>
                <xsl:if test="current-group()/child::*[not(self::heading)][not(self::refpt)]">
                  <bodytext>
                    <xsl:apply-templates select="current-group()/child::* except (heading | refpt)"/>
                  </bodytext>
                </xsl:if>
              </note>
            </xsl:when>
            <xsl:otherwise>
              <xsl:for-each select="current-group()">
                <xsl:apply-templates select="."/>
              </xsl:for-each>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each-group>
      </list>
    </xsl:template>
    Template l[@virtual-nesting='1'][$streamID='CA01' or $streamID='CA02CC' or $streamID='CA12' or $streamID='CA19' or $streamID='CA14' or $streamID='CA15' or $streamID='CA04' ]
    Documentation

    Description

    When l has attribute @virtual-nesting then it should be converted to real list nesting (mean's creating some parent nested list on basis of attribute value i.e. "@virtual-nesting='3'"). Drop @virtual-nesting and add n-1 list wrappers, where n is the value of @virtual-nesting. Please refer the below input and target markups for more clarification:

    Source XML having l/@virtual-nesting

    
    <l virtual-nesting="3">
        <li>
            <lilabel/>
            <p>
                <text><emph typestyle="bf">Unless the agreement provides otherwise...</emph></text>
            </p>
        </li>
    </l>
    
    	

    Target XML

    
    <list>
        <listitem>
          <bodytext>
            <p>
              <list>
                <listitem>
                  <bodytext>
                    <p>
                      <list>
                        <listitem>
                          <bodytext>
                            <p><text><emph typestyle="bf">Unless the agreement provides otherwise...</emph></text></p>
                          </bodytext>
                        </listitem>
                      </list>
                    </p>
                  </bodytext>
                </listitem>
              </list>
            </p>
          </bodytext>
        </listitem>
      </list>
    
            

    Description

     <topicref href="../../common_newest/Rosetta_l_virtual-nesting-LxAdv-list.dita"/> 
    Vikas Rohilla : updated for the streamID CA01  
     Sudhanshu Srivastava : Added CA02CC for listing conversion 
    Namespace No namespace
    Match l[@virtual-nesting='1'][$streamID='CA01' or $streamID='CA02CC' or $streamID='CA12' or $streamID='CA19' or $streamID='CA14' or $streamID='CA15' or $streamID='CA04' ]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="l[@virtual-nesting='1'][$streamID='CA01' or $streamID='CA02CC' or $streamID='CA12' or $streamID='CA19' or $streamID='CA14' or $streamID='CA15' or $streamID='CA04' ]" priority="2">
      <xsl:call-template name="virtualNesting">
        <xsl:with-param name="content" select="li"/>
        <xsl:with-param name="counter" select="number(@virtual-nesting)"/>
      </xsl:call-template>
    </xsl:template>
    Template l[@virtual-nesting]
    Documentation

    Description

     Assumes @virtual-nesting is always a digit and never less than 2 
    Namespace No namespace
    Match l[@virtual-nesting]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Source
    <xsl:template match="l[@virtual-nesting]">
      <xsl:choose>
        <xsl:when test="$streamID='CA01' and(starts-with(ancestor::case:decisionsummary/child::heading/title,'Court Summary:') or         starts-with(ancestor::case:decisionsummary/child::heading/title,'Court Summary:') or        starts-with(ancestor::case:decisionsummary/child::heading/title,'Résumé de la Cour :') or        starts-with(ancestor::case:decisionsummary/child::heading/title,'Commission Summary:') or        starts-with(ancestor::case:decisionsummary/child::heading/title,'Board Summary:') or        starts-with(ancestor::case:decisionsummary/child::heading/title,'Tribunal Summary:') or        starts-with(ancestor::case:decisionsummary/child::heading/title,'Executive Summary:') or        starts-with(ancestor::case:decisionsummary/child::heading/title,'Commissioner Summary:') or        starts-with(ancestor::case:decisionsummary/child::heading/title,'Résumé du tribunal :') or        starts-with(ancestor::case:decisionsummary/child::heading/title,'Sommaire du tribunal :') or        contains(ancestor::case:decisionsummary/child::heading/title,'Subsequent History') or contains(ancestor::case:decisionsummary/child::heading/title,'Historique subséquent') or contains(ancestor::case:decisionsummary/child::heading/title,'Court Catchwords') or contains(ancestor::case:decisionsummary/child::heading/title,'Indexation de la Cour') or contains(ancestor::case:decisionsummary/child::p[1]/text[1]/emph[1],'Subsequent History') or contains(ancestor::case:decisionsummary/child::p[1]/text[1]/emph[1],'Historique subséquent') or contains(ancestor::case:decisionsummary/child::p[1]/text[1]/emph[1],'Court Catchwords') or contains(ancestor::case:decisionsummary/child::p[1]/text[1]/emph[1],'Indexation de la Cour'))">
          <p>
            <list>
              <listitem>
                <bodytext>
                  <p>
                    <xsl:call-template name="virtualNesting">
                      <xsl:with-param name="content" select="li"/>
                      <xsl:with-param name="counter" select="number(@virtual-nesting)"/>
                    </xsl:call-template>
                  </p>
                </bodytext>
              </listitem>
            </list>
          </p>
        </xsl:when>
        <xsl:otherwise>
          <list>
            <listitem>
              <bodytext>
                <p>
                  <xsl:call-template name="virtualNesting">
                    <xsl:with-param name="content" select="li"/>
                    <xsl:with-param name="counter" select="number(@virtual-nesting)"/>
                  </xsl:call-template>
                </p>
              </bodytext>
            </listitem>
          </list>
        </xsl:otherwise>
      </xsl:choose>
      <!--  Original Target XPath:  list   -->
    </xsl:template>
    Template virtualNesting
    Namespace No namespace
    Used by
    References
    Template
    Variable
    Parameters
    QName Namespace
    content No namespace
    counter No namespace
    Import precedence 0
    Source
    <xsl:template name="virtualNesting">
      <xsl:param name="content"/>
      <xsl:param name="counter"/>
      <xsl:choose>
        <xsl:when test="($counter - 1)>1">
          <list>
            <listitem>
              <bodytext>
                <p>
                  <xsl:call-template name="virtualNesting">
                    <xsl:with-param name="content" select="$content"/>
                    <xsl:with-param name="counter" select="$counter - 1"/>
                  </xsl:call-template>
                </p>
              </bodytext>
            </listitem>
          </list>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="$streamID='CA04' or $streamID='CA02CC' or $streamID='CA12' or $streamID='CA19'">
              <xsl:choose>
                <xsl:when test="count(child::*) = 1 and (@virtual-nesting[.='1'] or not(@virtual-nesting))">
                  <list>
                    <listitem>
                      <xsl:apply-templates select="$content/lilabel"/>
                      <bodytext>
                        <xsl:apply-templates select="$content/(* except lilabel)"/>
                      </bodytext>
                    </listitem>
                  </list>
                </xsl:when>
                <xsl:when test="count(child::*) = 1">
                  <list>
                    <listitem>
                      <xsl:apply-templates select="$content/lilabel"/>
                      <bodytext>
                        <xsl:apply-templates select="$content/(* except lilabel)"/>
                      </bodytext>
                    </listitem>
                  </list>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:for-each select="child::*">
                    <list>
                      <xsl:apply-templates select="."/>
                    </list>
                  </xsl:for-each>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:when>
            <xsl:when test="$streamID='CA08'">
              <list>
                <listitem>
                  <bodytext>
                    <list>
                      <xsl:apply-templates select="$content | node() except lilabel"/>
                    </list>
                  </bodytext>
                </listitem>
              </list>
            </xsl:when>
            <xsl:when test="$streamID='CA15' or $streamID='CA01' or $streamID='CA14'">
              <list>
                <xsl:for-each select="child::*">
                  <xsl:apply-templates select="."/>
                </xsl:for-each>
              </list>
            </xsl:when>
            <xsl:otherwise>
              <list>
                <listitem>
                  <bodytext>
                    <xsl:apply-templates select="$content/*"/>
                  </bodytext>
                </listitem>
              </list>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template leg:comntryleg-comntry-generic
    Documentation

    Description

    • leg:comntry Becomes annot:annotations/annot:annotation-grp with optional attributes and child elements converted as:
      • @subdoc becomes @includeintoc
      • @toc-caption becomes @alternatetoccaption
      • heading/@searchtype becomes annot:annotation-grp/@grptype="COMMENTARY"

        Note: For GPL IN Content Stream leg:comntry/@searchtype becomes annot:annotation-grp/@grptype="COMMENTARY"

      • refpt becomes ref:anchor and must be the first child in the sequence. Refer to the refpt section for more information.
      • heading/edpnum becomes heading/desig
      • heading/title becomes heading/title

      Note: In the input Xpath, leg:comntry is allowed within leg:bodytext, but the target New Lexis Xpath allows annot:annotations to be a sibling to primlaw:bodytext and child element of primlaw:level i.e. leg:bodytext/leg:comntry becomes annot:annotations/annot:annotation-grp.

    • The conversion of level is determined by the value of @leveltype which also reflects the nesting structure.

      Note: Maintain source nesting.

    • If source document is having empty elements (i.e. bodytext/p/text and hrule) within leg:comntry then removed the empty markups from leg:comntry and leg:comntry should be mapped with annot:annotations. Please refer the below markups for understanding this scenario:

    Source XML

    
    <leg:comntry subdoc="true" toc-caption="Notes">
      <bodytext>
        <p><text> </text></p>
        <p><text> </text></p>
        <hrule/>
      </bodytext>
      <level id="NZREGS_REGS-H.SGM_PARA-2009R165S1-COMPENDIUM" leveltype="para0">
        <bodytext searchtype="COMMENTARY">
          ...
        </bodytext>
      </level>
     </leg:comntry>
    
    	

    Target XML

    
    <annot:annotations>
      <annot:annotation-grp includeintoc="true" alternatetoccaption="Notes">
        <annot:annotation xml:id="NZREGS_REGS-H.SGM_PARA-2009R165S1-COMPENDIUM">
          <bodytext>
            ...
          </bodytext>
        </annot:annotation>
      </annot:annotation-grp>
    </annot:annotations>
    
    	

    For GPL IN Content Streams

    GPL IN LEG Source XML

            
           <leg:comntry searchtype="commentary">
                 <level leveltype="comm1">
                      <bodytext>
                        <pgrp>
                          <heading searchtype="commentary">
                               <title align="center">COMMENTS</title>
                          </heading>
                        .....
                        </pgrp>
                    </bodytext>
                </level>
            </leg:comntry>
            
          

    GPL IN LEG Target XML

     
    <annot:annotations>
      <annot:annotation-grp grptype="COMMENTARY">
        <annot:annotation>
           <bodytext>
              <pgrp>
                <heading>
                  <title align="center">COMMENTS</title>
                </heading>
              ....
              </pgrp>
          </bodytext>
        </annot:annotation>
      </annot:annotation-grp>
    </annot:annotations>
            
          

    Description

     end topichead  l  
     start topichead  leg-comntry  
     <topicref href="../../common_newest/Rosetta_leg.comntry-LxAdv-annot.annotations-annot.annotation-grp.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_leg.comntry-LxAdv-annot.annotations-annot.annotation-grp.dita  
    Namespace No namespace
    Match leg:comntry
    Mode #default
    Used by
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="leg:comntry" name="leg-comntry-generic">
      <annot:annotations>
        <!-- based on the examples for comm.intro and group children, outputting the annotation group only in certain conditions 
    		 but what are they? -->
        <xsl:choose>
          <xsl:when test="child::*[not(self::level[@leveltype=('comm.intro' , 'group')])]">
            <annot:annotation-grp>
              <xsl:choose>
                <!-- 20170601:  MCJ:  Added 'AU06' to list. -->
                <xsl:when test="$streamID = ('AU04', 'AU05', 'AU06', 'AU08', 'NZ05','NZ06' , 'NZ12', 'NZ10', 'AU18')">
                  <xsl:apply-templates select="@*"/>
                  <xsl:if test="heading/@searchtype[.='COMMENTARY'] or level/heading[@searchtype='COMMENTARY'] or (starts-with($streamID, 'IN') and @searchtype[.='COMMENTARY'])">
                    <xsl:attribute name="grptype" select="'COMMENTARY'"/>
                  </xsl:if>
                  <xsl:apply-templates select="refpt | heading//refpt | bodytext/refpt"/>
                  <xsl:apply-templates select="heading"/>
                  <!-- JD: 2017-08-07: Adding for-each here to preserve ordering (don't just test that there is any child named bodytext, loop through each child and test self::); don't include levelinfo only having currency-statement (maps to doc:docinfo/currencystatement) -->
                  <xsl:for-each select="* except (refpt,heading,levelinfo[docinfo:currencystatement and count(*)=1])">
                    <xsl:choose>
                      <xsl:when test="self::bodytext">
                        <!-- 20170728:  MCJ:
    			                    An annotation wrapper should only be created if the bodytext transformation has results.  There are other instructions that suppress paragraphs and other
    			                    constructs when they are effectively empty (whitespace, tabs, etc.).  We attempted to do this by applying the regex of '[\t\s\p{Z}]+' to the string value
    			                    of the bodytext child (not an exact comparison of what apply-templates against the bodytext) but a possible encoding problem is causing the character count
    			                    to always be off.  As an alternative, the results of transforming bodytext are stored in a variable which is then evaluated.  For future reference, the
    			                    regex that was originally attempted is here within the comment.
    	
    			                        <xsl:variable name="bodytextString"><xsl:value-of select="bodytext" /></xsl:variable>
    			                        <xsl:variable name="replacedBodytextString" select="replace($bodytextString, '[\t\s\p{Z}]+', '')" />
    			                -->
                        <xsl:variable name="bodytextResult">
                          <xsl:apply-templates select="."/>
                          <!-- JD: 2017-08-07: changed from 'bodytext' to '.' since for-each loop has changed context node -->
                        </xsl:variable>
                        <!-- MCJ:  Test both the result as a string and also that it doesn't have child nodes... both suggest that the transform of bodytext has a result that should be
    			                           wrapped in an annotation.  Without this test, empty occurrences of annot:annotation are created. -->
                        <xsl:if test="normalize-space($bodytextResult) != '' or $bodytextResult/*">
                          <annot:annotation>
                            <xsl:apply-templates select="."/>
                          </annot:annotation>
                        </xsl:if>
                        <!-- JD: 2017-08-07: removing this; after for-each causing duplicates -->
                        <!--<xsl:apply-templates select="node() except (refpt | heading | bodytext)"/>-->
                      </xsl:when>
                      <!-- JD: 2017-08-08: when self is create <annot:annotation-grp> -->
                      <xsl:when test="self::level[@leveltype=('comm.intro' , 'group')]">
                        <xsl:apply-templates select="."/>
                      </xsl:when>
                      <!-- <xsl:when test="bodytext[string-length(replace(., '[\t\s\p{Z}]+', '')) != 0]">
    			                <xsl:variable name="bodytextString">
    			                  <xsl:value-of select="bodytext" />
    			                </xsl:variable>
    			                <blah>Text of bodytext is :<xsl:value-of select="replace($bodytextString, '[\t\s\p{Z}]+', '')" />:</blah>
    	                    <annot:annotation>
    	                      <xsl:apply-templates select="bodytext" />
    	                    </annot:annotation>
    			                <xsl:apply-templates select="node() except (refpt | heading | bodytext)"/>
    			              </xsl:when> -->
                      <xsl:otherwise>
                        <annot:annotation>
                          <!--<xsl:apply-templates select="@* | node() except (levelinfo[docinfo:currencystatement and count(*)=1])"/>-->
                          <xsl:apply-templates select="@*"/>
                          <xsl:apply-templates select="refpt | heading//refpt | bodytext/refpt"/>
                          <!-- JL from bodytext template, we are outputting level/glp:note in bodytext except for UK15, UK06 and 
    			              	    other xpaths that don't apply here -->
                          <xsl:choose>
                            <xsl:when test="$streamID= ('UK15' , 'UK06')">
                              <xsl:apply-templates select="node() except (refpt,levelinfo[docinfo:currencystatement and count(*)=1])"/>
                            </xsl:when>
                            <xsl:otherwise>
                              <xsl:apply-templates select="node() except (refpt,glp:note,levelinfo[docinfo:currencystatement and count(*)=1])"/>
                            </xsl:otherwise>
                          </xsl:choose>
                        </annot:annotation>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:for-each>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:apply-templates select="@*"/>
                  <xsl:if test="heading/@searchtype[.='COMMENTARY'] or level/heading[@searchtype='COMMENTARY'] or (starts-with($streamID, 'IN') and @searchtype[.='COMMENTARY'])">
                    <xsl:attribute name="grptype" select="'COMMENTARY'"/>
                  </xsl:if>
                  <xsl:apply-templates select="refpt | heading//refpt | bodytext/refpt"/>
                  <xsl:apply-templates select="node() except refpt"/>
                </xsl:otherwise>
              </xsl:choose>
            </annot:annotation-grp>
          </xsl:when>
          <xsl:otherwise>
            <xsl:apply-templates select="node() except refpt"/>
          </xsl:otherwise>
        </xsl:choose>
      </annot:annotations>
    </xsl:template>
    Template leg:comntry/@subdoc | level[ancestor::leg:comntry]/@subdoc
    Documentation

    Description

     these are common attributes for all generic "level" elements as well as leg:comntry, so we might as well handle once and done 
    Namespace No namespace
    Match leg:comntry/@subdoc | level[ancestor::leg:comntry]/@subdoc
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:comntry/@subdoc | level[ancestor::leg:comntry]/@subdoc">
      <xsl:attribute name="includeintoc">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template leg:comntry/@toc-caption | level[ancestor::leg:comntry]/@toc-caption
    Namespace No namespace
    Match leg:comntry/@toc-caption | level[ancestor::leg:comntry]/@toc-caption
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:comntry/@toc-caption | level[ancestor::leg:comntry]/@toc-caption">
      <xsl:attribute name="alternatetoccaption">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template leg:comntry/@includeintoc | level[ancestor::leg:comntry]/@includeintoc
    Namespace No namespace
    Match leg:comntry/@includeintoc | level[ancestor::leg:comntry]/@includeintoc
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:comntry/@includeintoc | level[ancestor::leg:comntry]/@includeintoc">
      <xsl:attribute name="toc-caption">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template leg:comntry/bodytext/p[normalize-space(string-join(text , ''))=''][not(child::*[not(self::text[normalize-space(string-join(. , ''))=''])])]
    Namespace No namespace
    Match leg:comntry/bodytext/p[normalize-space(string-join(text , ''))=''][not(child::*[not(self::text[normalize-space(string-join(. , ''))=''])])]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:comntry/bodytext/p[normalize-space(string-join(text , ''))=''][not(child::*[not(self::text[normalize-space(string-join(. , ''))=''])])]"/>
    Template leg:comntry//hrule
    Namespace No namespace
    Match leg:comntry//hrule
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:comntry//hrule"/>
    Template level[ancestor::level[parent::leg:comntry]][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]
    Documentation

    Description

     per updated CIs if we come across leveltypes we don't recognize, right now we just output them same as para0/subpara0  
    Namespace No namespace
    Match level[ancestor::level[parent::leg:comntry]][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="level[ancestor::level[parent::leg:comntry]][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]">
      <annot:annotationlevel>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="refpt | heading/descendant::refpt | bodytext/refpt"/>
        <xsl:apply-templates select="heading"/>
        <xsl:if test="child::*[not(self::refpt or self::heading)]">
          <annot:bodytext>
            <xsl:apply-templates select="node() except (heading | refpt)"/>
          </annot:bodytext>
        </xsl:if>
      </annot:annotationlevel>
    </xsl:template>
    Template level[ancestor::level[parent::leg:comntry]][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]/bodytext
    Namespace No namespace
    Match level[ancestor::level[parent::leg:comntry]][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]/bodytext
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="level[ancestor::level[parent::leg:comntry]][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]/bodytext">
      <xsl:apply-templates select="@* | node() except refpt"/>
    </xsl:template>
    Template level[parent::leg:comntry][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]
    Namespace No namespace
    Match level[parent::leg:comntry][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="level[parent::leg:comntry][not(@leveltype=('para0', 'subpara0' , 'comm.intro' , 'group'))]">
      <annot:annotation>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="refpt | heading/descendant::refpt | bodytext/refpt"/>
        <xsl:apply-templates select="node() except refpt"/>
      </annot:annotation>
    </xsl:template>
    Template leg:comntry[parent::bodytext[ancestor::leg:comntry]]
    Documentation

    Description

     JL  to handle nested leg:comntry in all sorts of ridiculousness found as far as I know only in HK01.
      This is really kludgy, there is no way around kludgy with this stuff. We do simliar things for legfragments
      
    Namespace No namespace
    Match leg:comntry[parent::bodytext[ancestor::leg:comntry]]
    Mode #default
    References
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="leg:comntry[parent::bodytext[ancestor::leg:comntry]]" priority="25">
      <blockquote>
        <primlaw:level leveltype="unclassified">
          <xsl:call-template name="leg-comntry-generic"/>
        </primlaw:level>
      </blockquote>
    </xsl:template>
    Template level[ancestor::leg:comntry][@leveltype=('group' , 'comm.intro')]
    Documentation

    Description

    • @leveltype="comm.intro" becomes annot:annotation-grp with optional attributes and child elements converted as:
      • @subdoc becomes @includeintoc
      • @toc-caption becomes @alternatetoccaption
      • heading/@searchtype becomes annot:annotation-grp/@grptype="COMMENTARY"
      • refpt becomes ref:anchor and must be the first child in the sequence. Refer to the refpt section for more information.
      • heading/edpnum becomes heading/desig
      • heading/title becomes heading/title
      • bodytext becomes annot:annotation/bodytext
                   
                      Example: Source XML 1
                                    
    
    <leg:comntry>
        <level id="PFI_CODES.SGM_COMM.INTRO_1" leveltype="comm.intro" toc-caption="FOREWORD" subdoc="true">
            <heading searchtype="COMMENTARY"><title>FOREWORD</title></heading>
            <bodytext searchtype="COMMENTARY">
                <p><text>As the Minister for Finance, Superannuation and.....</text></p>
            </bodytext>
        </level>
    </leg:comntry>
    
                   
                      Example: Target XML 1
                   
                  
    
    <annot:annotations>
    		<annot:annotation-grp xml:id="PFI_CODES.SGM_COMM.INTRO_1" grptype="COMMENTARY" alternatetoccaption="FOREWORD" includeintoc="true">
    			<heading><title>FOREWORD</title></heading>
    			<annot:annotation>
    				<bodytext>
    					<p><text>As the Minister for Finance, Superannuation and.....</text></p>
    				</bodytext>
    			</annot:annotation>
    	 </annot:annotation-grp>
    </annot:annotations>
    
           
                  
                      Example: Source XML 2
                                    
    
    <leg:comntry>
        <level id="AEFP_ASX3.SGM_COMM.INTRO_8" leveltype="comm.intro" toc-caption="Appendices to ASX Operating Rules Procedures" subdoc="true">
            <heading searchtype="COMMENTARY"><title>Appendices to ASX Operating Rules Procedures</title></heading>
            <level id="AEFP_ASX3.SGM_GROUP_9" leveltype="group" toc-caption="Contents" subdoc="true">
                <heading searchtype="COMMENTARY"><title>Contents</title></heading>
                <bodytext searchtype="COMMENTARY">
                   <p><table frame="none" pgwide="1">
                          <tgroup cols="3" colsep="0" rowsep="0" align="left">
                            <colspec colwidth="65*" colname="col1" colsep="0" rowsep="0"/>
                            <colspec colwidth="205*" colname="col2" colsep="0" rowsep="0"/>
                            <colspec colwidth="30*" colname="col3" align="right" colsep="0" rowsep="0"/>
                            <tbody valign="top">
                                <row rowsep="0">
                                    <entry morerows="0" colsep="0" rowsep="0">SECTION 1</entry>
                                    ....
                                </row>
                            </tbody>
                        </tgroup>
                    </table></p>
                </bodytext>
            </level>
        </level>
    </leg:comntry>
    
                  
                      Example: Target XML 2
                   
                  
    <annot:annotations>
    	<annot:annotation-grp xml:id="AEFP_ASX3.SGM_COMM.INTRO_8" grptype="COMMENTARY" alternatetoccaption="Appendices to ASX Operating Rules Procedures" includeintoc="true">
    		<heading><title>Appendices to ASX Operating Rules Procedures</title></heading>
    		<annot:annotation-grp xml:id="AEFP_ASX3.SGM_GROUP_9" grptype="COMMENTARY" alternatetoccaption="Contents" includeintoc="true">
    		  <heading><title>Contents</title></heading>
    		  <annot:annotation>
    			  <bodytext>
    				  <p><table frame="none" pgwide="1">
                            <tgroup cols="3" colsep="0" rowsep="0" align="left">
                            <colspec colwidth="65*" colname="col1" colsep="0" rowsep="0"/>
                            <colspec colwidth="205*" colname="col2" colsep="0" rowsep="0"/>
                            <colspec colwidth="30*" colname="col3" align="right" colsep="0" rowsep="0"/>
                            <tbody valign="top">
                                  <row rowsep="0">
                                      <entry morerows="0" colsep="0" rowsep="0">SECTION 1</entry>
                                      ....
                                  </row>
                            </tbody>
                        </tgroup>
                    </table></p>
    			     </bodytext>
    		     </annot:annotation>
    	    </annot:annotation-grp>
    	</annot:annotation-grp>
    </annot:annotations>
           

    Note: For the scenario, leg:comntry/level/glp:note add a attribute value @notetype="xref" to note in order to distinguish from other notes.

    Note: Refer common markup for handling of glp:note.

    Note: For handling of glp:note/blockquote/hrule omit hrule and presentation stylesheet will handle formatting.


    Description

    • @leveltype="group" becomes annot:annotation-grp with optional attributes and child elements converted as:
      • @subdoc becomes @includeintoc
      • @toc-caption becomes @alternatetoccaption
      • heading/@searchtype becomes annot:annotation-grp/@grptype="COMMENTARY"
      • refpt becomes ref:anchor and must be the first child in the sequence. Refer to the refpt section for more information.
      • heading/edpnum becomes heading/desig
      • heading/title becomes heading/title
      • bodytext becomes annot:annotation/bodytext
                           
                              Example: Source XML
                                            
      
      <leg:comntry toc-caption="Reader's Guide" subdoc="true">
            <heading searchtype="COMMENTARY">
                <title>
                  <refpt type="ext" id="CLSA.VOFF.ARRS.RGUIDE"/>
                  Reader's Guide
                </title>
            </heading>
            <level 
              id="CLSA_VOFF.SGM_GROUP_2" 
              leveltype="group" 
              toc-caption="Aim of the Guide" 
              subdoc="true">
                <heading searchtype="COMMENTARY">
                    <title>
                      <refpt type="ext" id="CLSA.VOFF.29035-1"/>
                      Aim of the Guide
                    </title>
                </heading>
                <bodytext searchtype="COMMENTARY">
                    <p>
                        <text>
                            The aim of this Guide...
                        </text>
                    </p>
                </bodytext>
            </level>
        </leg:comntry>
      
                           
                              Example: Target XML
                           
      
      <annot:annotations>
          <annot:annotation-grp 
            grptype="COMMENTARY" 
            alternatetoccaption="Reader's Guide" 
            includeintoc="true">
              <ref:anchor 
                id="CLSA.VOFF.ARRS.RGUIDE" 
                anchortype="global"/>
              <heading>
                <title>Reader's Guide</title>
              </heading>
                <annot:annotation-grp 
                  xml:id="CLSA_VOFF.SGM_GROUP_2" 
                  grptype="COMMENTARY" 
                  alternatetoccaption="Aim of the Guide" 
                  includeintoc="true">
                      <ref:anchor 
                        id="CLSA.VOFF.29035-1" 
                        anchortype="global"/>
                      <heading>
                        <title>Aim of the Guide</title>
                      </heading>
                  <annot:annotation>
                    <bodytext>
                      <p>
                        <text>
                          The aim of this Guide ...
                        </text>
                      </p>
                    </bodytext>
                  </annot:annotation>
               </annot:annotation-grp>
          </annot:annotation-grp>
      </annot:annotations>
      
      

      Note: For the scenario, leg:comntry/level/glp:note add a attribute value @notetype="xref" to note in order to distinguish from other notes.

      Note: If glp:note occurs before heading then move the note inside bodytext after heading.

      Note: Refer common markup for handling of glp:note.

      Note: For handling of glp:note/blockquote/hrule omit hrule and presentation stylesheet will handle formatting.


    Description

     <topicref href="../../common_newest/Rosetta_leg.comntry-level_LEVELTYPE_COMM.INTRO-LxAdv-annot.annotations-annot.annotation-grp.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_leg.comntry-level_LEVELTYPE_COMM.INTRO-LxAdv-annot.annotations-annot.annotation-grp.dita  
     ****************************************************************************************************
    	This file is so completely identical except in attribute value of the matching "level" element, that 
    	the functionality has been moved to 
    	/XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_leg.comntry-level_LEVELTYPE_GROUP-LxAdv-annot.annotations-annot.annotation-grp.xsl
    	THIS MODULE IS INACTIVE.
    	- JL
    	****************************************************************************************************
    	
     <topicref href="../../common_newest/Rosetta_leg.comntry-level_LEVELTYPE_GROUP-LxAdv-annot.annotations-annot.annotation-grp.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_leg.comntry-level_LEVELTYPE_GROUP-LxAdv-annot.annotations-annot.annotation-grp.dita  
     this is entirely identical to the comm.intro module and therefore the comm.intro module is handled here 
    Namespace No namespace
    Match level[ancestor::leg:comntry][@leveltype=('group' , 'comm.intro')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="level[ancestor::leg:comntry][@leveltype=('group' , 'comm.intro')]">
      <!--  Original Target XPath:  annot:annotations/annot:annotation-grp/annot:annotation-grp   -->
      <annot:annotation-grp>
        <xsl:if test="heading[@searchtype='COMMENTARY'] or heading[contains(title, '[Commentary]')]">
          <xsl:attribute name="grptype" select="'COMMENTARY'"/>
        </xsl:if>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="refpt | heading//refpt | bodytext/refpt"/>
        <!-- JD: 2017-08-08: added NZ06 here and to exclusion list below in order to match DT output (output header within <annot:annotation-grp> per instruction in DITA above, rather than within <annot:annotation>). -->
        <xsl:apply-templates select="heading[$streamID=('AU08','AU04','NZ06' , 'NZ12', 'AU18')]"/>
        <!-- paul: see AU08 PS2017050300592679148LNIAUCOURTRULES_input_crimproc10061174.xml where heading is in group not in annotation  -->
        <xsl:if test="*[not(self::levelinfo[source_docinfo:currencystatement] or self::level or self::refpt or self::glp:note or self::heading[$streamID=('AU04', 'AU08' , 'NZ12', 'AU18')])]">
          <annot:annotation>
            <xsl:choose>
              <xsl:when test="heading[preceding-sibling::glp:note]">
                <xsl:apply-templates select="node() except (refpt | glp:note | heading[$streamID=('AU08', 'AU04','NZ06' , 'NZ12')])"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:apply-templates select="node() except (level |refpt | heading[$streamID=('AU08', 'AU04','NZ06' , 'NZ12', 'AU18')])"/>
              </xsl:otherwise>
            </xsl:choose>
          </annot:annotation>
        </xsl:if>
        <xsl:apply-templates select="level"/>
      </annot:annotation-grp>
    </xsl:template>
    Template level[ancestor::leg:comntry]/@leveltype
    Documentation

    Description

     note: we need to do something about refpt moving holistically. Where are the target, valid places? 
     suppress the output of leg:comntry descendant level/@leveltype or else it gets copied. This should cover all leveltypes 
    Namespace No namespace
    Match level[ancestor::leg:comntry]/@leveltype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="level[ancestor::leg:comntry]/@leveltype"/>
    Template level[ancestor::leg:comntry][@leveltype='para0']
    Documentation

    Description

    • @leveltype="para0" becomes annot:annotation with optional attributes and child elements converted as:
      • @subdoc becomes @includeintoc
      • @toc-caption becomes @alternatetoccaption
      • heading/@searchtype becomes annot:annotation-grp/@grptype="COMMENTARY"
      • refpt becomes ref:anchor and must be the first child in the sequence. Refer to the refpt section for more information.
      • heading/edpnum becomes heading/desig
      • heading/title becomes heading/title
      • bodytext becomes bodytext
                           
                              Example: Source XML
                                            
      
      <leg:comntry subdoc="true" toc-caption="COMMENTARY ON REGULATION 12">
      	<heading searchtype="COMMENTARY">
      		<title><refpt id="CLWA.SL.SARW03.REG12.COM1" type="ext"/>COMMENTARY ON REGULATION 12</title>
      	</heading>
      	<level id="CLWA_SL.SGM_CLWA.SL.SARR12-1" leveltype="para0" subdoc="true" toc-caption="[SAR r 12.1] Cross references">
      		<heading searchtype="COMMENTARY">
      			<edpnum><refpt id="CLWA.SL.SARR12-1" type="ext"/>[SAR r 12.1] </edpnum>
      			<title>Cross references</title>
      		</heading>
      		<bodytext searchtype="COMMENTARY">
      			<p><text>See Halsbury's Laws of Australia Criminal Law [335&#x2013;40] for details on the
      			powers and duties of prison officers, including the search of prisoners, in other jurisdictions.</text></p>
      		</bodytext>
      	</level>
      </leg:comntry>
      
                           
                              Example: Target XML
                           
                    
      
      <annot:annotations>
      	<annot:annotation-grp grptype="COMMENTARY" includeintoc="true" alternatetoccaption="COMMENTARY ON REGULATION 12">
      		<ref:anchor id="CLWA.SL.SARW03.REG12.COM1" anchortype="global"/>
      		<heading><title>COMMENTARY ON REGULATION 12</title></heading>
      		<annot:annotation xml:id="CLWA_SL.SGM_CLWA.SL.SARR12-1" alternatetoccaption="[SAR r 12.1] Cross references"
               includeintoc="true">
      			<ref:anchor id="CLWA.SL.SARR12-1" anchortype="global"/>
      			<heading>
      				<desig>[SAR r 12.1]</desig>
      				<title>Cross references</title>
      			</heading>
      			<bodytext>
      				<p><text>See Halsbury's Laws of Australia Criminal Law [335&#x2013;40] for details
      				on the powers and duties of prison officers, including the search of prisoners, in 
      				other jurisdictions.</text></p>
      			</bodytext>
      		</annot:annotation>
      	</annot:annotation-grp>
      </annot:annotations>
      
       


    Description

     JL I guess the instructions means this? 
      JL 20171012 removed because it is ambiguous with same-output template for leg:comntry
    <xsl:template match="level[ancestor::leg:comntry]/glp:note/blockquote/hrule"/>
     <topicref href="../../common_newest/Rosetta_leg.comntry-level_LEVELTYPE_PARA0-LxAdv-annot.annotations-annot.annotation-grp.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_leg.comntry-level_LEVELTYPE_PARA0-LxAdv-annot.annotations-annot.annotation-grp.dita  
    Namespace No namespace
    Match level[ancestor::leg:comntry][@leveltype='para0']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="level[ancestor::leg:comntry][@leveltype='para0']">
      <annot:annotation>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="refpt | heading/descendant::refpt | bodytext/refpt"/>
        <xsl:if test="$streamID='AU07' and child::*[1][self::glp:note]">
          <xsl:apply-templates select="glp:note"/>
        </xsl:if>
        <xsl:apply-templates select="heading"/>
        <xsl:choose>
          <xsl:when test="bodytext">
            <xsl:apply-templates select="node() except (refpt | heading | glp:note)"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:if test="not($streamID='AU07' and child::*[1][self::glp:note])">
              <bodytext>
                <xsl:apply-templates select="glp:note"/>
              </bodytext>
            </xsl:if>
            <xsl:apply-templates select="node() except (refpt | heading | glp:note)"/>
          </xsl:otherwise>
        </xsl:choose>
      </annot:annotation>
    </xsl:template>
    Template level[@leveltype='subpara0'][ancestor::leg:comntry]
    Documentation

    Description

    • @leveltype="subpara0" becomes annot:annotationlevel with optional attributes and child elements converted as:
      • @subdoc becomes @includeintoc
      • @toc-caption becomes @alternatetoccaption
      • heading/@searchtype becomes annot:annotation-grp/@grptype="COMMENTARY"
      • refpt becomes ref:anchor and must be the first child in the sequence. Refer to the refpt section for more information.
      • heading/edpnum becomes heading/desig
      • heading/title becomes heading/title
      • bodytext becomes bodytext
                           
                              Example: Source XML
                                            
      
      <leg:comntry subdoc="true" toc-caption="Commentary">
      	<level id="ACLL_CCPA.SGM_GROUP_2" leveltype="para0" toc-caption="Outline" subdoc="true">
      		<heading searchtype="COMMENTARY"><title>Outline</title></heading>
      		<bodytext searchtype="COMMENTARY">
      			<p><text>The Corporations (Commonwealth Powers) Acts 2001 [State] are Acts which....</text></p>
      		</bodytext>
      		<level id="ACLL_CCPA.SGM_GROUP_3" leveltype="subpara0" toc-caption="Provisions" subdoc="true">
      			<heading searchtype="COMMENTARY"><title>Provisions</title></heading>
      			<bodytext searchtype="COMMENTARY">
      				<p><text>This Act enacts ancillary provisions, including transitional provisions...</text></p>
      			</bodytext>
      		</level>
      	</level>
      </leg:comntry>
      
                           
                              Example: Target XML
                           
                    
      
      <annot:annotations>
      	<annot:annotation-grp alternatetoccaption="Commentary" includeintoc="true">
      		<annot:annotation xml:id="ACLL_CCPA.SGM_GROUP_2" alternatetoccaption="Outline" includeintoc="true">
      			<heading><title>Outline</title></heading>
      			<bodytext>
      				<p><text>The Corporations (Commonwealth Powers) Acts 2001 [State] are Acts which....</text></p>
      			</bodytext>
      			<annot:annotationlevel xml:id="ACLL_CCPA.SGM_GROUP_3" alternatetoccaption="Provisions" includeintoc="true">
      				<heading><title>Provisions</title></heading>
      				<annot:bodytext>
      					<p><text>This Act enacts ancillary provisions, including transitional provisions...</text></p>
      				</annot:bodytext>
      			</annot:annotationlevel>
      		</annot:annotation>
      	</annot:annotation-grp>
      </annot:annotations>
      
                      


    Description

     <topicref href="../../common_newest/Rosetta_leg.comntry-level_LEVELTYPE_SUBPARA0-LxAdv-annot.annotations-annot.annotation-grp.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_leg.comntry-level_LEVELTYPE_SUBPARA0-LxAdv-annot.annotations-annot.annotation-grp.dita  
    Namespace No namespace
    Match level[@leveltype='subpara0'][ancestor::leg:comntry]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="level[@leveltype='subpara0'][ancestor::leg:comntry]">
      <annot:annotationlevel>
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="refpt | heading/descendant::refpt | bodytext/refpt"/>
        <xsl:apply-templates select="heading"/>
        <xsl:if test="child::*[not(self::refpt or self::heading)]">
          <annot:bodytext>
            <xsl:apply-templates select="node() except (heading | refpt)"/>
          </annot:bodytext>
        </xsl:if>
        <!-- JL: annot:bodytext is requires so do this if there is no content at all. -->
        <xsl:if test="not(child::*[not(self::refpt or self::heading)])">
          <annot:bodytext>
            <p/>
          </annot:bodytext>
        </xsl:if>
      </annot:annotationlevel>
      <!--<annot:annotationlevel>
    			<xsl:apply-templates select="@*"/>
    			<xsl:apply-templates select="refpt | heading/descendant::refpt | bodytext/refpt"/>
    			<xsl:apply-templates select="node() except (refpt | level)"/>
    		  <xsl:if test="not(bodytext) and level">
    		    <annot:bodytext>
    		      <xsl:apply-templates select="node() except (heading)"/>
    		    </annot:bodytext>
    		  </xsl:if>
    		</annot:annotationlevel>-->
    </xsl:template>
    Template level[@leveltype='subpara0'][ancestor::leg:comntry]/bodytext
    Namespace No namespace
    Match level[@leveltype='subpara0'][ancestor::leg:comntry]/bodytext
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="level[@leveltype='subpara0'][ancestor::leg:comntry]/bodytext">
      <xsl:apply-templates select="@* | node() except refpt"/>
    </xsl:template>
    Template legfragment//leg:level
    Documentation

    Description

    legfragment becomes primlaw:excerpt. blockquote/legfragment/leg:level: When legfragment is the first child of blockquote, drop the blockquote and convert the legfragment to primlaw:excerpt. If the Xpath is blockquote/legfragment/leg:level, then drop the blockquote and convert to primlaw:excerpt/primlaw:level.

    
    <leg:level id="NSW_ACT_2009-100_SCH1AMCL12"><leg:level-vrnt leveltype="clause" searchtype="LEGISLATION" subdoc="true" toc-caption="[12] Section 97CB Annual greenhouse gas benchmark statements">....
    <leg:levelbody>
    <leg:bodytext>
    <p>
    <text>Omit section 97CB (1). Insert instead:</text>
    </p>
    <blockquote>
    <legfragment>
    <leg:level>
    <leg:level-vrnt leveltype="subclause">
    <leg:heading
    inline="true">
    <desig><designum>(1)</designum></desig>
    </leg:heading>
    <leg:levelbody>
    <leg:bodytext>
    <p>
    <text>A benchmark participant must lodge with the Tribunal a greenhouse gas benchmark statement:</text>
    <l type="def">
    <li><lilabel>(a)</lilabel>
    <p>
    <text>in respect of a compliance period (other than the final compliance period), not later than 1 March in the year immediately
    following the end of that compliance period, or</text>
    </p>
    </li>
    <li><lilabel>(b)</lilabel>
    <p>
    <text>in respect of the final compliance period, not later than 3 months after the termination day.</text>
    </p>
    </li>
    </l>
    
            
    Becomes
          
    
    <primlaw:level xml:id="NSW_ACT_2009-100_SCH1AMCL12" leveltype="clause" subdoc="true" toc-caption="[12] Section 97CB Annual
     greenhouse gas benchmark statements">.....
     <primlaw:bodytext>
     <p>
     <text>Omit section 97CB (1). Insert instead:</text>
      </p>
      <primlaw:excerpt>
      <primlaw:level leveltype="subclause">
      <heading inline="true"><desig>(1)</desig></heading><primlaw:bodytext>
      <p>
      <text>A benchmark participant must lodge with the Tribunal a greenhouse gas benchmark statement:</text>
      <list>
        <listitem>
          <label>(a)</label>
          <bodytext>
          <p>
          <text>in respect of a compliance period (other than the final compliance period), not later than 1 March in the
          year immediately following the end of that compliance period, or
          </text>
          </p>
          </bodytext>
        </listitem>
       <listitem>
          <label>(b)</label>
          <bodytext>
          <p>
          <text>in respect of the final compliance period, not later than 3 months after the termination
            day.
          </text>
          </p>
          </bodytext>
        </listitem> 
      </list>
    
            


    Description

     end topichead  leg-comntry  
     start topichead  legfragment  
     <topicref href="../../common_newest/Rosetta_blockquote-legfragment-leg.level-LxAdv-primlaw.excerpt-primlaw.level.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_blockquote-legfragment-leg.level-LxAdv-primlaw.excerpt-primlaw.level.dita  
     JL separated out the templates because I need to convert legfragment without leg:level in it for other modules 
    	 blockquote passthrough is effected in the blockquote module 
    	 
    Namespace No namespace
    Match legfragment//leg:level
    Mode #default
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="legfragment//leg:level" priority="25">
      <!--  Original Target XPath:  primlaw:excerpt/primlaw:level   -->
      <primlaw:level>
        <xsl:if test="not(leg:level-vrnt/@leveltype)">
          <xsl:attribute name="leveltype">unclassified</xsl:attribute>
        </xsl:if>
        <xsl:apply-templates select="leg:level-vrnt/@*"/>
        <!-- 2017-09-25 - MDS removed 'leg:level-vrnt/leg:heading/desig/designum/refpt' from A-T to stop duplication due to handling of leg:level-vrnt in 
    			  /modules/leg/leg.level-LxAdv-primlaw.level.xsl-->
        <xsl:apply-templates select="leg:heading/desig/designum/refpt"/>
        <xsl:apply-templates select="@* | node()"/>
      </primlaw:level>
    </xsl:template>
    Template legfragment
    Documentation

    Description

     I assume we want to output excerpt level children without running them through bodytext first  JL 
    Namespace No namespace
    Match legfragment
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="legfragment">
      <!--  Original Target XPath:  primlaw:excerpt   -->
      <primlaw:excerpt>
        <xsl:apply-templates select="@*"/>
        <xsl:for-each-group select="*" group-adjacent="if (self::leg:level) then 0 else 1">
          <xsl:choose>
            <xsl:when test="current-grouping-key()=0">
              <xsl:apply-templates select="current-group()"/>
            </xsl:when>
            <xsl:otherwise>
              <primlaw:bodytext>
                <xsl:apply-templates select="current-group()"/>
              </primlaw:bodytext>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each-group>
      </primlaw:excerpt>
    </xsl:template>
    Template legfragment[child::*[1][self::p or self::l or self::table or self::leg:level or self::deflist]]
    Documentation

    Description

    blockquote/legfragment/p: If the first child of legfragment is a paragraph, list, or table, then omit blockquote and convert legfragment to primlaw:excerpt/primlaw:bodytext.

    Note: In all cases, primlaw:excerpt comes as a sibling of p under bodytext because p doesn't allow primlaw:excerpt.

    Note: For more information regarding legfragment within blockquote, please see the instructions for blockquote.

     <footnote fntoken="ABCE.LEG.EAN95.S47.FTN1"
                fnrtokens="ABCE.LEG.EAN95.S47.FTN1-R" type="default">
                <fnlabel>*</fnlabel> <fnbody> <h>Commonwealth
                variations</h> <p><refpt type="ext" id="ABCE.LEG.EAN95.S47.FTN1"/>
                <text>Section 47 of the Commonwealth Act concludes:</text>
                <blockquote> <legfragment> <p> <text>&ldquo;Note: Section
                182 gives this section a wider application in relation to Commonwealth records and
                certain Commonwealth documents.&rdquo;</text></p> </legfragment>
                </blockquote> </p> </fnbody> </footnote> 
    Becomes
     <footnote> <ref:anchor id="ABCE.LEG.EAN95.S47.FTN1"
                anchortype="global"/> <label>*</label> <bodytext>
                <h>Commonwealth variations</h> <p> <ref:anchor
                id="ABCE.LEG.EAN95.S47.FTN1" anchortype="global"/> <text>Section 47 of the
                Commonwealth Act concludes:</text> </p> <primlaw:excerpt>
                <primlaw:bodytext> <p> <text>&#x201C;Note: Section 182 gives this
                section a wider application in relation to Commonwealth records and certain Commonwealth
                documents.&#x201D;</text> </p> </primlaw:bodytext>
                </primlaw:excerpt> </bodytext> ... </footnote> 


    Description

     <topicref href="../../common_newest/Rosetta_blockquote-legfragment-p-LxAdv-primlaw.excerpt-primlaw.bodytext-p.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_blockquote-legfragment-p-LxAdv-primlaw.excerpt-primlaw.bodytext-p.dita  
    Namespace No namespace
    Match legfragment[child::*[1][self::p or self::l or self::table or self::leg:level or self::deflist]]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 30
    Source
    <xsl:template match="legfragment[child::*[1][self::p or self::l or self::table or self::leg:level or self::deflist]]" priority="30">
      <xsl:choose>
        <xsl:when test="$streamID = 'NZ03'">
          <blockquote>
            <xsl:apply-templates select="@* | node()"/>
          </blockquote>
        </xsl:when>
        <xsl:otherwise>
          <!-- JD: 2017-07-25: Original contents here: 	
    	    	 	<primlaw:bodytext>
    	          <xsl:apply-templates/>
    	        </primlaw:bodytext>
    	        but this had the side effect of wrapping all content in primlaw:bodytext; adding logic to output sibling <primlaw:level> when required.
    	    	
            JL 20171027: changed for-each-group select="node()" to select="*" because it was picking up on whitespace nodes 
            to output empty bodytext elements and legfragment has no PCDATA children in the dtd.
            -->
          <primlaw:excerpt>
            <xsl:for-each-group select="*" group-adjacent="boolean(self::*:level)">
              <xsl:choose>
                <!-- when current element is *:level (e.g., leg:level) A-T to produce primlaw:level -->
                <xsl:when test="current-grouping-key()">
                  <xsl:apply-templates select="current-group()"/>
                </xsl:when>
                <!-- otherwise create a <primlaw:bodytext> wrapper and process children -->
                <xsl:otherwise>
                  <primlaw:bodytext>
                    <xsl:apply-templates select="current-group()"/>
                  </primlaw:bodytext>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:for-each-group>
          </primlaw:excerpt>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template legfragment/glp:note
    Documentation

    Description

    legfragment/glp:note: Handling of glp:note when it occurs within legfragment:

                 <blockquote>
                <legfragment>
                 <glp:note>
                  <p>
                   <text>
                    <emph typestyle="it">for this provision.</emph>
                    </text>
                  </p>
              </glp:note>
         </legfragment>
    </blockquote>
    
     
    Becomes
            <primlaw:excerpt>
              <primlaw:bodytext>   
              <note>                          
              <bodytext>
              <p>
              <text>
              <emph typestyle="it">for this</emph>
              </text>
              </p>
              </bodytext>
              </note>
              </primlaw:bodytext>
              </primlaw:excerpt>
        
          


    Description

     <topicref href="../../common_newest/Rosetta_legfragment-glp.note-LxAdv-primlaw.excerpt-primlaw.bodytext-note.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_legfragment-glp.note-LxAdv-primlaw.excerpt-primlaw.bodytext-note.dita  
    Namespace No namespace
    Match legfragment/glp:note
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="legfragment/glp:note">
      <!--  Original Target XPath:  primlaw:excerpt/primlaw:bodytext/note   -->
      <primlaw:excerpt>
        <primlaw:bodytext>
          <note>
            <xsl:apply-templates select="@*"/>
            <xsl:apply-templates select="heading"/>
            <bodytext>
              <xsl:apply-templates select="node() except(heading)"/>
            </bodytext>
          </note>
        </primlaw:bodytext>
      </primlaw:excerpt>
    </xsl:template>
    Template p/blockquote/legfragment
    Documentation

    Description

    p/blockquote/legfragment: Handling of p/blockquote/legfragment:

           <p>
           <text>The meaning of sexual penetration for the purposes of subdivisions (8A) to (8G) of Div 1 of Pt 1 of the Crimes Act 1958 is defined in s 35(1) of the Crimes Act in the following terms:</text>
       <blockquote>
          <legfragment>
            <deflist>
              <defitem>
                <defterm>
                     <emph typestyle="bf">sexual penetration</emph>
                </defterm>
                <defdesc>
              <p>
              <text>means</text>
              </p>
              ...
              </defdesc>
              </defitem>
            </deflist>
          </legfragment>
       </blockquote>
    </p>
     
          
    Becomes
           <p>
           <text>The meaning of sexual penetration for the purposes of subdivisions (8A) to (8G) of Div 1 of Pt 1 of the Crimes Act 1958 is defined in s 35(1) of the Crimes Act in the following terms:</text></p>
           <primlaw:excerpt>
          <primlaw:bodytext>
            <deflist>
              <defitem>
                <defterm>
                     <emph typestyle="bf">sexual penetration</emph>
                </defterm>
               <defdesc>
              <bodytext>
              <p>
              <text>means</text>
              </p>
              ...
              </bodytext>
              </defdesc>
              </defitem>
            </deflist>
            </primlaw:bodytext>
          </primlaw:excerpt>
      
     
    


    Description

     <topicref href="../../common_newest/Rosetta_p-blockquote-legfragment-LxAdv-primlaw.excerpt-primlaw.bodytext.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_p-blockquote-legfragment-LxAdv-primlaw.excerpt-primlaw.bodytext.dita  
     JL: passthru for blockquote/legfragment is in blockquote template.  Here we just need to insert the wrappers 
    Namespace No namespace
    Match p/blockquote/legfragment
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p/blockquote/legfragment">
      <primlaw:excerpt>
        <xsl:apply-templates select="@*"/>
        <xsl:for-each-group select="*" group-adjacent="if (self::leg:level) then 0 else 1">
          <xsl:choose>
            <xsl:when test="current-grouping-key()=0">
              <xsl:apply-templates select="current-group()"/>
            </xsl:when>
            <xsl:otherwise>
              <primlaw:bodytext>
                <xsl:apply-templates select="current-group()"/>
              </primlaw:bodytext>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each-group>
      </primlaw:excerpt>
    </xsl:template>
    Template link[not(parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp or parent::text[parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp])]generic-link
    Documentation
    Namespace No namespace
    Match link[not(parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp or parent::text[parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp])]
    Mode #default
    Used by
    References
    Import precedence 0
    Source
    Template link/@status
    Namespace No namespace
    Match link/@status
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="link/@status"/>
    Template link/@smi
    Namespace No namespace
    Match link/@smi
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="link/@smi"/>
    Template link/@filename
    Namespace No namespace
    Match link/@filename
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="link/@filename"/>
    Template link/@type
    Namespace No namespace
    Match link/@type
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="link/@type">
      <xsl:choose>
        <xsl:when test=".=('para','page', 'ed-pnum','refpt','logo')">
          <xsl:message>attachment-type is invalid, cannot be determined.</xsl:message>
        </xsl:when>
        <xsl:when test=".=('pdf' , 'pdf-fillable')">PDF</xsl:when>
        <xsl:when test=".='hotdoc-nonfillable'">hotdoc</xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="."/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template link[parent::ci:content]
    Documentation

    Description

     MDS - 2017-03-14 - Passes through children of link if parent is ci:content
            This is taken from /Rosetta-to-LA/modules/nonamespace/Rosetta_ci.cite-LxAdv-lnci.cite.xsl documentation.  Also copied to documentation in this module.
    Namespace No namespace
    Match link[parent::ci:content]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="link[parent::ci:content]">
      <xsl:apply-templates/>
    </xsl:template>
    Template link[@refpt][not($streamID='AU21' or 'USLPA')]
    Documentation

    Description

     Vikas Rohilla : Template to match the link[@refpt]
     JL removing status att because it's not valid in output schema and some modules copy it 
    Namespace No namespace
    Match link[@refpt][not($streamID='AU21' or 'USLPA')]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="link[@refpt][not($streamID='AU21' or 'USLPA')]" priority="25">
      <ref:lnlink>
        <ref:marker>
          <xsl:apply-templates/>
        </ref:marker>
        <ref:locator>
          <xsl:apply-templates select="@* except @status"/>
        </ref:locator>
      </ref:lnlink>
    </xsl:template>
    Template link[not(@*)][.='']
    Documentation

    Description

     Vikas Rohilla : Handle the empty link having no attributes and the content webstar #7045989 
    Namespace No namespace
    Match link[not(@*)][.='']
    Mode #default
    Import precedence 0
    Priority 10
    Source
    <xsl:template match="link[not(@*)][.='']" priority="10"/>
    Template link/@alttext
    Documentation

    Description

     MDS - 2017-09-07 Unhandled in NZ07-DN Examples in CI show the @alttext dropped.  There are no obviously matching structures in the ref:lnlink or ref:marker elements for LA.
    Namespace No namespace
    Match link/@alttext
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="link/@alttext"/>
    Template link[@refpt][not(@type or @smi or @filename)]
    Documentation

    Description

    If link only has the attribute @refpt, then the following instructions should be used:

    • link becomes ref:lnlink.
    • The content of link becomes ref:marker.
    • Create ref:locator and populate the attribute ref:locator/@anchoridref with the value of link/@refpt.

    Note: ref:locator/@anchoridref that begins with a number must have an underscore added at start. Also apply other identifier data type format as used for xml:id and ref:anchor/@id (e.g. change colon to underscore). Refer to the section titled "Identifiers to ID Data Type - Handling Pattern Restrictions", if that section exists in this CI.

    Note: If the link element source also includes a @dpsi, the attribute should be dropped.

    Source XML: only attribute of link is refpt

    
    <link refpt="x98-1174a2">page 324 line 46</link>
    
    			

    Target XML: only attribute of link is refpt

    
    <ref:lnlink>
        <ref:marker>page 324 line 46</ref:marker>
        <ref:locator anchoridref="x98-1174a2"/>
    </ref:lnlink>
    
    			

    Note: CA02-CC : emph will be dropped in link/emph.


    Description

     <topicref href="../../common_newest/Rosetta_link_refpt-LxAdv-ref.lnlink-ref.locator_anchoridref.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_link_refpt-LxAdv-ref.lnlink-ref.locator_anchoridref.dita  
     Vikas Rohilla : updated the priority attribute because the ambigous math with in the file Rosetta_link-LxAdv-ref.lnlink.xsl at line 177 
    Namespace No namespace
    Match link[@refpt][not(@type or @smi or @filename)]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="link[@refpt][not(@type or @smi or @filename)]" priority="2">
      <ref:lnlink>
        <ref:marker>
          <xsl:choose>
            <xsl:when test="$streamID='CA02-CC'">
              <xsl:value-of select="."/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:apply-templates select="node()"/>
            </xsl:otherwise>
          </xsl:choose>
        </ref:marker>
        <ref:locator>
          <xsl:attribute name="anchoridref">
            <xsl:apply-templates select="@refpt"/>
          </xsl:attribute>
        </ref:locator>
      </ref:lnlink>
    </xsl:template>
    Template link/@refpt
    Namespace No namespace
    Match link/@refpt
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="link/@refpt">
      <xsl:attribute name="anchoridref">
        <xsl:call-template name="normalizeIdString"/>
      </xsl:attribute>
    </xsl:template>
    Template link/@dpsi
    Namespace No namespace
    Match link/@dpsi
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="link/@dpsi"/>
    Template bodytext/link | leg:bodytext/link
    Documentation
    Namespace No namespace
    Match bodytext/link | leg:bodytext/link
    Mode #default
    References
    Import precedence 0
    Priority 30
    Source
    Template bodytext/link[$streamID='NZ06'] | leg:bodytext/link[$streamID='NZ06']
    Documentation

    Description

     JD: 2017-08-08: added and set @priority to 31 for NZ06 to match DT output, where <ref:lnlink> occurs directly under <primlaw:bodytext> 
    Namespace No namespace
    Match bodytext/link[$streamID='NZ06'] | leg:bodytext/link[$streamID='NZ06']
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Priority 31
    Source
    <xsl:template match="bodytext/link[$streamID='NZ06'] | leg:bodytext/link[$streamID='NZ06']" priority="31">
      <xsl:call-template name="generic-link"/>
    </xsl:template>
    Template bodytext[parent::level[@leveltype=('prec.grp' , 'precgrp' , 'precgrp1' , 'precgrp2' , 'prec', 'form')] or parent::level[@leveltype='comm.chap'][level[@leveltype=('prec.grp' , 'precgrp1' , 'precgrp' , 'precgrp2' , 'prec', 'form')]][not(level[@leveltype='para0'])]]/link
    Namespace No namespace
    Match bodytext[parent::level[@leveltype=('prec.grp' , 'precgrp' , 'precgrp1' , 'precgrp2' , 'prec', 'form')] or parent::level[@leveltype='comm.chap'][level[@leveltype=('prec.grp' , 'precgrp1' , 'precgrp' , 'precgrp2' , 'prec', 'form')]][not(level[@leveltype='para0'])]]/link
    Mode #default
    References
    Import precedence 0
    Priority 31
    Source
    Template case:decisiondate/@ln.user-displayed[.='false']
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    When ln.user-displayed="false" appears on any date element (i.e. case:decisiondate ln.user-displayed="false"), that element is translated into the target but with the element content omitted. Only the attributes are populated. So there is no displayable content.

    The attribute decision:decisiondate/@normdate should be populated with the values of case:decisiondate/date/@year, case:decisiondate/date/@month and case:decisiondate/date/@day concatenated and separated by a single hyphen. The values of case:decisiondate/date/@month and case:decisiondate/date/@day should be padded with zeroes so that they are 2 digits.

    Note: If one or more of the three date values (year, month or day) are absent, then decision:decisiondate/@normdate should not be populated.

    Source XML

    
    <case:decisiondate ln.user-displayed="false">
      <date year="1995" month="04" day="8">8 April 1995</date> 
    </case:decisiondate>
    
    	

    Target XML

    
    <decision:dates>  
        <decision:decisiondate year="1995" month="04" day="08" normdate="1995-04-08"/>
    </decision:dates>
    
    	

    Description

     end topichead  link  
     start topichead  ln.user_displayed  
     temp note 04/12/2013 from andrew martin 
     <topicref href="../../common_newest/Rosetta_levelinfo_classification-LxAdv-SUPPRESS.dita"/> 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    <xsl:include href="../../modules/nonamespace/Rosetta_levelinfo_classification-LxAdv-SUPPRESS.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_case.decisiondate_ln.user-displayed-LxAdv-decision.dates.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_case.decisiondate_ln.user-displayed-LxAdv-decision.dates.dita  
     Vikas Rohilla : compleated  
    Namespace No namespace
    Match case:decisiondate/@ln.user-displayed[.='false']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:decisiondate/@ln.user-displayed[.='false']"/>
    Template case:disposition/@ln.user-displayed[.='false']
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If case:disposition has attribute @ln.user-displayed="false" then suppress it.

    Source XML

    
    <case:disposition ln.user-displayed="false">Appeal dismissed.</case:disposition>
    
    

    Target XML

    
    <!-- output Suppressed -->
            
                

    Description

     <topicref href="../../common_newest/Rosetta_case.disposition_ln.user-displayed.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_case.disposition_ln.user-displayed.dita  
    Namespace No namespace
    Match case:disposition/@ln.user-displayed[.='false']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:disposition/@ln.user-displayed[.='false']"/>
    Template case:judges/@ln.user-displayed[.='false']
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If case:judges has attribute @ln.user-displayed="false" : data has been fixed by LBU so it won't occur in updated data. In meantime conversion can suppress it.

    Source XML

    
    <case:judges ln.user-displayed="false">
        <emph typestyle="bf">WILLIAMS J</emph>
    </case:judges>
    
    

    Target XML

    
    <!-- output Suppressed -->
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_case.judges_ln.user-displayed.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_case.judges_ln.user-displayed.dita  
     Vikas Rohilla : compleated 
    Namespace No namespace
    Match case:judges/@ln.user-displayed[.='false']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judges/@ln.user-displayed[.='false']"/>
    Template case:reportercite/@ln.user-displayed[.='false']
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If case:reportercite has attribute @ln.user-displayed="false" then map to citation as usual. Suppress the attribute @ln.user-displayed.

    Source XML

    
    <case:reportercite ln.user-displayed="false">
        <ci:cite type="cite4thisdoc">
            <ci:case>
                <ci:caseinfo>
                    <ci:decisiondate year="2009"/>
                </ci:caseinfo>
                <ci:caseref>
                    <ci:reporter value="ALR"/>
                    <ci:volume num="256"/>
                    <ci:edition>
                        <ci:date year="2009"/>
                    </ci:edition>
                    <ci:page num="25"/>
                    <ci:pinpoint targettype="para" num="4"/>
                </ci:caseref>
            </ci:case>
            <ci:content>
                <citefragment searchtype="CASE-CITE-REF">(2009) 256 ALR 25</citefragment>
            </ci:content>
        </ci:cite>
    </case:reportercite>
    
    

    Target XML

    
    <ref:citations>
        <ref:cite4thisresource citetype="reporter">
            <lnci:cite>
                <lnci:case>
                    <lnci:caseinfo>
                        <lnci:decisiondate year="2009"/>
                    </lnci:caseinfo>
                    <lnci:caseref>
                        <lnci:reporter value="ALR"/>
                        <lnci:volume num="256"/>
                        <lnci:edition>
                            <lnci:date year="2009"/>
                        </lnci:edition>
                        <lnci:page num="25"/>
                        <lnci:pinpoint targettype="para" num="4"/>
                    </lnci:caseref>
                </lnci:case>
                <lnci:content>(2009) 256 ALR 25</lnci:content>
            </lnci:cite>
        </ref:cite4thisresource>
    </ref:citations>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_case.reportercite_ln.user-displayed-LxAdv-ref.citations.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_case.reportercite_ln.user-displayed-LxAdv-ref.citations.dita  
     Vikas Rohilla 
    Namespace No namespace
    Match case:reportercite/@ln.user-displayed[.='false']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:reportercite/@ln.user-displayed[.='false']"/>
    Template epdnum[@ln.user-displayed='false']
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If edpnum has attribute @ln.user-displayed="false" then map to desig or altdesig as usual but no element content carried forward. Only the attribute @value is populated.

    Source XML

    
    <edpnum ln.user-displayed="false">2343</edpnum>
    
    

    Target XML

    
    <desig value="2343"/>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_edpnum_ln.user-displayed.dita"/> 
     CSN: Created pednum when @ln.user-displayed='false' 
    Namespace No namespace
    Match epdnum[@ln.user-displayed='false']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="epdnum[@ln.user-displayed='false']">
      <xsl:element name="desig">
        <xsl:attribute name="value">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:element>
    </xsl:template>
    Template heading[@ln.user-displayed = 'false']
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If heading has attribute @ln.user-displayed="false" the element is suppressed.

    Source XML

     <leg:heading ln.user-displayed="false"> <title>Preliminary</title> </leg:heading> 

    Target XML

     <!-- output Suppressed --> 

    Source XML

     <level id="ASC_ARCHIVE.SGM_MISC.INS_2" leveltype="miscins"> <heading ln.user-displayed="false"> <title>[Instrument]</title> </heading> ...
              </level> 

    Target XML

     <!-- output Suppressed --> 

    Source XML

     <leg:heading ln.user-displayed="false"> <title>Preliminary</title> </leg:heading> 

    Target XML

     <!-- output Suppressed --> 

    Source XML

     <leg:juris ln.userdisplayed="false">NSW</leg:juris> 

    Target XML

     <jurisinfo:legisbodyinfo> <jurisinfo:jurisdiction> <jurisinfo:system>NSW</jurisinfo:system> </jurisinfo:jurisdiction> </jurisinfo:legisbodyinfo>
              <dc:metadata> <dc:coverage> <location:state codescheme="ISO-3166-2" statecode="AU-NS">NSW</location:state> </dc:coverage> </dc:metadata> 

    Description

     <topicref href="../../common_newest/Rosetta_heading_ln.user-displayed.dita"/> 
    Namespace No namespace
    Match heading[@ln.user-displayed = 'false']
    Mode #default
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="heading[@ln.user-displayed = 'false']" priority="25"/>
    Template leg:heading[@ln.user-displayed = 'false']
    Documentation

    Description

     suppress 
    Namespace No namespace
    Match leg:heading[@ln.user-displayed = 'false']
    Mode #default
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="leg:heading[@ln.user-displayed = 'false']" priority="25"/>
    Template leg:heading[@ln.user-displayed='false' and not(parent::leg:level-vrnt)]
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If leg:heading has attribute @ln.user-displayed="false" the element is suppressed.

    Source XML

    
    <leg:heading ln.user-displayed="false">
        <title>Preliminary</title>
    </leg:heading>
    
                

    Target XML

    
    <!-- output Suppressed -->
    
                

    Description

     suppress 
     <topicref href="../../common_newest/Rosetta_leg.heading_ln.user-displayed.dita"/> 
    Namespace No namespace
    Match leg:heading[@ln.user-displayed='false' and not(parent::leg:level-vrnt)]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:heading[@ln.user-displayed='false' and not(parent::leg:level-vrnt)]"/>
    Template leg:levelinfo[leg:levelstatus]
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If leg:juris has attribute @ln.user-displayed="false" then map it as usual (as if the @ln.user-displayed did not exist).

    Source XML

    
    <leg:juris ln.userdisplayed="false">NSW</leg:juris>
    
                

    Target XML

    
        <jurisinfo:legisbodyinfo>
            <jurisinfo:jurisdiction>
                <jurisinfo:system>NSW</jurisinfo:system>
            </jurisinfo:jurisdiction>
        </jurisinfo:legisbodyinfo>
        
        <dc:metadata>
            <dc:coverage>
                <location:state codescheme="ISO-3166-2" statecode="AU-NS">NSW</location:state>
            </dc:coverage>
        </dc:metadata>
    
                

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If leg:levelstatus has attribute @isrepealed="true" then map the @statuscode regardless of whether @ln.user-displayed exists or not. If the attribute @ln.user-displayed exists, then don't create the statustext element (but retain the @statuscode as stated here).

    Source XML

    
    <leg:levelstatus isrepealed="true" ln.userdisplayed="false">(Repealed)</leg:levelstatus>
    
                

    Target XML

    
    <legisinfo:status statuscode="repealed" />
    
                

    Description

     <topicref href="../../common_newest/Rosetta_leg.juris_ln.user-displayed.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_leg.juris_ln.user-displayed.dita  
     JL Nothing to do or see here.  Commenting out of HK01 driver; this will validate if empty but is pretty useless. 
     <topicref href="../../common_newest/Rosetta_leg.levelstatus_ln.user-displayed.dita"/> 
    	<xsl:template match="leg:levelstatus[@ln.user-displayed='false' and @isrepealed='true']">
    
    		<!-\-  Original Target XPath:  statustext   -\->
    		<legisinfo:statusgroup>
    		  <legisinfo:status>
    		    <xsl:attribute name="statuscode" select="'repealed'"/>
    		  </legisinfo:status>
    		</legisinfo:statusgroup>
    
    	</xsl:template>
     MDS 2017-05-18 - Functionality in general module leg.levelstatus 
    <xsl:template match="leg:levelstatus[@ln.user-displayed='false' and not(@isrepealed='true')]"/>
    xsl:template match="leg:levelinfo[* and not(*[not(self::leg:levelstatus)])]"
     JD: 2017-08-01: rewriting rule; original rule intended to apply when the only child of 
    		leg:levelinfo is leg:levelstatus, which omits that output when other elements are present 
    Namespace No namespace
    Match leg:levelinfo[leg:levelstatus]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:levelinfo[leg:levelstatus]">
      <xsl:choose>
        <xsl:when test="leg:levelstatus/@isrepealed='true'">
          <primlaw:levelinfo>
            <primlawinfo:primlawinfo>
              <legisinfo:legisinfo>
                <xsl:apply-templates select="node() except (source_docinfo:authorattribution)"/>
              </legisinfo:legisinfo>
            </primlawinfo:primlawinfo>
          </primlaw:levelinfo>
        </xsl:when>
        <xsl:otherwise/>
      </xsl:choose>
    </xsl:template>
    Template leg:levelstatus[@isrepealed = 'true'][$streamID='UK12']
    Namespace No namespace
    Match leg:levelstatus[@isrepealed = 'true'][$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="leg:levelstatus[@isrepealed = 'true'][$streamID='UK12']">
      <legisinfo:statusgroup>
        <legisinfo:status>
          <xsl:attribute name="statuscode" select="'repealed'"/>
        </legisinfo:status>
      </legisinfo:statusgroup>
    </xsl:template>
    Template leg:levelstatus[parent::leg:levelinfo][$streamID=('HK06')]
    Namespace No namespace
    Match leg:levelstatus[parent::leg:levelinfo][$streamID=('HK06')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="leg:levelstatus[parent::leg:levelinfo][$streamID=('HK06')]"/>
    Template leg:officialname
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If leg:officialname has attribute @ln.user-displayed="false" becomes legisinfo:officialtitle with attribute source="editoriallyassigned"

    Note: In order to enable searching and indexing while retaining the display integrity of the information. The @source attribute will be populated with "editoriallyassigned" indicating these fields were assigned their value. The viewspec will utilize the @source attribute to choose whether to display this information differently or not at all depending on the needs of the LBU users.

    Source XML

    
    <leg:officialname searchtype="LEGISLATION" ln.user-displayed="false">SUPREME COURT (FOREIGN JUDGMENTS) RULES 1993</leg:officialname>
    
                

    Target XML

    
    <legisinfo:names>
    <legisinfo:officialtitle source="editoriallyassigned">SUPREME COURT (FOREIGN JUDGMENTS) RULES 1993</legisinfo:officialtitle>
    </legisinfo:names>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_leg.officialname_ln.user-displayed-LxAdv-legisinfo.officialtitle.dita"/> 
     MCJ:  Single template to handle leg:officialname.  This collapses the specific instructions around @ln.user-displayed="false" with the
                 generic-case of no @ln.user-displayed and the lack of @ln.user-displayed. 
    Namespace No namespace
    Match leg:officialname
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:officialname">
      <!--  JL: ref:anchor is not valid in legisinfo:officialtitle   -->
      <xsl:choose>
        <xsl:when test="parent::leg:info">
          <legisinfo:names>
            <legisinfo:officialtitle>
              <xsl:apply-templates select="@*"/>
              <!-- MCJ:  Only create the @source attribute of 'editoriallyassigned' if @ln.user-displayed="false". -->
              <xsl:if test="@ln.user-displayed='false'">
                <xsl:attribute name="source">editoriallyassigned</xsl:attribute>
              </xsl:if>
              <xsl:apply-templates select="node() except refpt"/>
            </legisinfo:officialtitle>
          </legisinfo:names>
        </xsl:when>
        <xsl:otherwise>
          <legisinfo:legisinfo>
            <legisinfo:names>
              <legisinfo:officialtitle>
                <xsl:apply-templates select="@*"/>
                <!-- MCJ:  Only create the @source attribute of 'editoriallyassigned' if @ln.user-displayed="false". -->
                <xsl:if test="@ln.user-displayed='false'">
                  <xsl:attribute name="source">editoriallyassigned</xsl:attribute>
                </xsl:if>
                <xsl:apply-templates select="node() except refpt"/>
              </legisinfo:officialtitle>
            </legisinfo:names>
          </legisinfo:legisinfo>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template leg:officialname/@ln.user-displayed
    Namespace No namespace
    Match leg:officialname/@ln.user-displayed
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:officialname/@ln.user-displayed"/>
    Template leg:officialname/@searchtype
    Namespace No namespace
    Match leg:officialname/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:officialname/@searchtype"/>
    Template leg:officialnum
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    If leg:officialnum has attribute @ln.user-displayed="false" becomes primlawinfo:identifier with attribute source="editoriallyassigned"

    Note: In order to enable searching and indexing while retaining the display integrity of the information. The @source attribute will be populated with "editoriallyassigned" indicating these fields were assigned their value. The viewspec will utilize the @source attribute to choose whether to display this information differently or not at all depending on the needs of the LBU users.

    Source XML

    
    <leg:officialnum searchtype="LEGISLATION" ln.user-displayed="false">Act No. 91, 1993</leg:officialnum>
    
                

    Target XML

    <primlawinfo:identifier idtype="officialnum" source="editoriallyassigned">Act No. 91, 1993</primlawinfo:identifier>
           
             

    Description

    <topicref href="../../common_newest/Rosetta_AU-Regulatory_Material_leg.officialname_ln.user-displayed-LxAdv-admindoc.officialtitle.dita"/>
     <topicref href="../../common_newest/Rosetta_leg.officialnum_ln.user-displayed-LxAdv-primlawinfo.identifier_source.dita"/> 
     MCJ:  Single template to handle leg:officialnum.  This collapses the specific instructions around @ln.user-displayed="false" with the
                 generic-case of no @ln.user-displayed and the lack of @ln.user-displayed. 
    Namespace No namespace
    Match leg:officialnum
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:officialnum">
      <primlawinfo:identifier>
        <xsl:apply-templates select="@*"/>
        <xsl:attribute name="idtype" select="'officialnum'"/>
        <!-- MCJ:  Set @source='editoriallyassigned' if @ln.user-displayed is explicitly set to 'false'.  -->
        <xsl:if test="@ln.user-displayed='false'">
          <xsl:attribute name="source" select="'editoriallyassigned'"/>
        </xsl:if>
        <xsl:apply-templates select="node()"/>
      </primlawinfo:identifier>
    </xsl:template>
    Template leg:officialnum/@searchtype | leg:officialnum/@ln.user-displayed
    Documentation

    Description

     JD: @searchtype not mentioned in DITA, but examples illustrate this is suppressed. 
    Namespace No namespace
    Match leg:officialnum/@searchtype | leg:officialnum/@ln.user-displayed
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:officialnum/@searchtype | leg:officialnum/@ln.user-displayed"/>
    Template leg:year[@ln.user-displayed='false']
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    When leg:year has attribute @ln.user-displayed="false" (i.e. leg:year/@ln.user-displayed="false"), that element is translated into the target but with the element content omitted. Only the attributes are populated. So there is no displayable content.

    Source XML

    
    <leg:year searchtype="LEGISLATION" ln.userdisplayed="false">1970</leg:year>
    
                

    Target XML

    
    <primlawinfo:dates>
        <primlawinfo:enactdate year="1970"/>
    </primlawinfo:dates>
    
                

    Description

     <topicref href="../../common_newest/Rosetta_leg.year_ln.user-displayed.dita"/> 
     JD: 2017-07-27: the instructions for this are ambiguous; I read it 
    		as the <primlaw:enactdate> is used as an example of when only date attributes and not 
    		content would be output, i.e., the target element for leg:year could be different
    		(as in NZ06, where the target is <primlawinfo:assentdate>).
    		
    		If that reading is correct, then this template should just output attributes
    	
    Namespace No namespace
    Match leg:year[@ln.user-displayed='false']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:year[@ln.user-displayed='false']">
      <primlawinfo:dates>
        <primlawinfo:enactdate>
          <xsl:if test="matches(normalize-space(.) , '^[1|2]\d{3}$')">
            <xsl:attribute name="year">
              <xsl:value-of select="normalize-space(.)"/>
            </xsl:attribute>
          </xsl:if>
        </primlawinfo:enactdate>
      </primlawinfo:dates>
    </xsl:template>
    Template leg:year[not(@ln.user-displayed)]
    Documentation

    Description

     Awantika: When leg:year does not have an attribute ln.user-displayed 
    Namespace No namespace
    Match leg:year[not(@ln.user-displayed)]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="leg:year[not(@ln.user-displayed)]">
      <primlawinfo:dates>
        <primlawinfo:enactdate>
          <xsl:if test="matches(normalize-space(.) , '^[1|2]\d{3}$')">
            <xsl:attribute name="year">
              <xsl:value-of select="normalize-space(.)"/>
            </xsl:attribute>
          </xsl:if>
        </primlawinfo:enactdate>
        <!-- Awantika: In AU20 primlawinfo:assentdate need to be merged inside primlawinfo:dates -->
        <xsl:if test="$streamID='AU20'">
          <xsl:apply-templates select="parent::leg:info/leg:dates/leg:assentdate" mode="legdate"/>
        </xsl:if>
      </primlawinfo:dates>
    </xsl:template>
    Template @ln.user-displayed
    Namespace No namespace
    Match @ln.user-displayed
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="@ln.user-displayed"/>
    Template leg:level
    Namespace No namespace
    Match leg:level
    Mode #default
    Import precedence 0
    Priority 35
    Source
    <xsl:template match="leg:level" priority="35">
      <!--  Original Target XPath:  primlaw:level   -->
      <xsl:choose>
        <xsl:when test="parent::legfragment/parent::blockquote">
          <!--<primlaw:excerpt>-->
          <primlaw:level>
            <xsl:choose>
              <xsl:when test="leg:level-vrnt[@leveltype='sect']">
                <xsl:attribute name="leveltype" select="'section'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='subsect']">
                <xsl:attribute name="leveltype" select="'subsection'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='sched']">
                <xsl:attribute name="leveltype" select="'schedule'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='prov1']">
                <xsl:attribute name="leveltype" select="'section'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='prov2']">
                <xsl:attribute name="leveltype" select="'subsection'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='prov3']">
                <xsl:attribute name="leveltype" select="'paragraph'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='prov4']">
                <xsl:attribute name="leveltype" select="'subparagraph'"/>
              </xsl:when>
              <xsl:when test="ancestor:: leg:level/leg:level-vrnt[@leveltype='sched']/leg:level-vrnt[@leveltype='prov1']">
                <xsl:attribute name="leveltype" select="'paragraph'"/>
              </xsl:when>
              <xsl:when test="ancestor:: leg:level/leg:level-vrnt[@leveltype='sched']/leg:level-vrnt[@leveltype='prov2']">
                <xsl:attribute name="leveltype" select="'subparagraph'"/>
              </xsl:when>
              <xsl:when test="ancestor:: leg:level/leg:level-vrnt[@leveltype='sched']/leg:level-vrnt[@leveltype='prov3']">
                <xsl:attribute name="leveltype" select="'subparagraph'"/>
              </xsl:when>
              <xsl:when test="ancestor:: leg:level/leg:level-vrnt[@leveltype='sched']/leg:level-vrnt[@leveltype='prov4']">
                <xsl:attribute name="leveltype" select="'subparagraph'"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="leveltype" select="if(number(leg:level-vrnt/@leveltype)) then 'unclassified' else leg:level-vrnt/@leveltype"/>
              </xsl:otherwise>
            </xsl:choose>
            <!-- <xsl:if test="(not(refpt) or not(leg:level-vrnt/refpt) or not(parent::leg:body/descendant::level/refpt) or not(parent::leg:body/descendant::leg:comntry/refpt) or   not(leg:level-vrnt/leg:levelbody/refpt) or not(leg:level-vrnt/refpt) or not(leg:level-vrnt/leg:heading/refpt) or not(leg:level-vrnt/leg:levelbody/refpt)) and not(parent::leg:endmatter or parent::leg:body)">
    				<ref:anchor id="TOC00{position()}" anchortype="local"/>
    			</xsl:if>-->
            <xsl:apply-templates select="@* | node()"/>
          </primlaw:level>
          <!--</primlaw:excerpt>-->
        </xsl:when>
        <xsl:otherwise>
          <primlaw:level>
            <xsl:choose>
              <xsl:when test="leg:level-vrnt[@leveltype='sect']">
                <xsl:attribute name="leveltype" select="'section'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='subsect']">
                <xsl:attribute name="leveltype" select="'subsection'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='sched']">
                <xsl:attribute name="leveltype" select="'schedule'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='prov1']">
                <xsl:attribute name="leveltype" select="'section'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='prov2']">
                <xsl:attribute name="leveltype" select="'subsection'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='prov3']">
                <xsl:attribute name="leveltype" select="'paragraph'"/>
              </xsl:when>
              <xsl:when test="leg:level-vrnt[@leveltype='prov4']">
                <xsl:attribute name="leveltype" select="'subparagraph'"/>
              </xsl:when>
              <xsl:when test="ancestor:: leg:level/leg:level-vrnt[@leveltype='sched']/leg:level-vrnt[@leveltype='prov1']">
                <xsl:attribute name="leveltype" select="'paragraph'"/>
              </xsl:when>
              <xsl:when test="ancestor:: leg:level/leg:level-vrnt[@leveltype='sched']/leg:level-vrnt[@leveltype='prov2']">
                <xsl:attribute name="leveltype" select="'subparagraph'"/>
              </xsl:when>
              <xsl:when test="ancestor:: leg:level/leg:level-vrnt[@leveltype='sched']/leg:level-vrnt[@leveltype='prov3']">
                <xsl:attribute name="leveltype" select="'subparagraph'"/>
              </xsl:when>
              <xsl:when test="ancestor:: leg:level/leg:level-vrnt[@leveltype='sched']/leg:level-vrnt[@leveltype='prov4']">
                <xsl:attribute name="leveltype" select="'subparagraph'"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="leveltype" select="if(number(leg:level-vrnt/@leveltype)) then 'unclassified' else leg:level-vrnt/@leveltype"/>
              </xsl:otherwise>
            </xsl:choose>
            <!-- <xsl:if test="(not(refpt) or not(leg:level-vrnt/refpt) or not(parent::leg:body/descendant::level/refpt) or not(parent::leg:body/descendant::leg:comntry/refpt) or   not(leg:level-vrnt/leg:levelbody/refpt) or not(leg:level-vrnt/refpt) or not(leg:level-vrnt/leg:heading/refpt) or not(leg:level-vrnt/leg:levelbody/refpt)) and not(parent::leg:endmatter or parent::leg:body)">
    				<ref:anchor id="TOC00{position()}" anchortype="local"/>
    			</xsl:if>-->
            <xsl:apply-templates select="@* | node()"/>
          </primlaw:level>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template leg:level/@id
    Namespace No namespace
    Match leg:level/@id
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:level/@id">
      <!--  Original Target XPath:  @xml:id   -->
      <xsl:attribute name="xml:id" select="."/>
    </xsl:template>
    Template leg:level/@subdoc
    Namespace No namespace
    Match leg:level/@subdoc
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:level/@subdoc">
      <!--  Original Target XPath:  @includeintoc   -->
      <xsl:attribute name="includeintoc" select="."/>
    </xsl:template>
    Template leg:level/@toc-caption
    Namespace No namespace
    Match leg:level/@toc-caption
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:level/@toc-caption">
      <!--  Original Target XPath:  @alternatetoccaption   -->
      <xsl:attribute name="alternatetoccaption" select="."/>
    </xsl:template>
    Template leg:level-vrnt
    Namespace No namespace
    Match leg:level-vrnt
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:level-vrnt">
      <!--  Original Target XPath:  @leveltype   -->
      <xsl:apply-templates select="node()"/>
    </xsl:template>
    Template leg:levelbody
    Namespace No namespace
    Match leg:levelbody
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:levelbody">
      <!--  Original Target XPath:  primlaw:bodytext   -->
      <xsl:choose>
        <!-- Checking if leg:bodytext is comming simultanious under leg:levelbody. -->
        <xsl:when test="*[1][self::leg:bodytext]">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="@* | node()"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template leg:heading
    Namespace No namespace
    Match leg:heading
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:heading">
      <!--  Original Target XPath:  heading   -->
      <heading>
        <xsl:apply-templates select="@* | node() except leg:empleg"/>
      </heading>
      <xsl:apply-templates select="leg:empleg"/>
    </xsl:template>
    Template leg:heading/@align
    Namespace No namespace
    Match leg:heading/@align
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:heading/@align">
      <!--  Original Target XPath:  @align   -->
      <xsl:attribute name="align" select="."/>
    </xsl:template>
    Template leg:heading/@inline
    Namespace No namespace
    Match leg:heading/@inline
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="leg:heading/@inline">
      <!--  Original Target XPath:  @inline   -->
      <xsl:attribute name="inline" select="."/>
    </xsl:template>
    Template refnum[@ln.user-displayed='false']
    Documentation

    Description

    Note: Elements that contain the attribute @ln.user-displayed="false" are used for certain functionality in Rosetta that does not exist in Lexis Advance. Each of the following elements have mappings described elsewhere in this CI for when this attribute does not exist. The examples here are ONLY for when this @ln.user-displayed="false" appears. (This attribute never has a "true" value, i.e. @ln.user-displayed="true".)

    When refnum has attribute @ln.user-displayed="false" (i.e. refnum/@ln.user-displayed="false"), that element is translated into the target but with the element content omitted. Only the attributes are populated. So there is no displayable content.

    Source XML

    
    <refnum refnumtype="UCN" ln.user-displayed="false">00836591</refnum>
    
                

    Target XML

    
    <refnum refnumscheme="UCN" num="00836591"/>
    
                

    Description

      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_refnum_ln.user-displayed.dita  
    Namespace No namespace
    Match refnum[@ln.user-displayed='false']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="refnum[@ln.user-displayed='false']">
      <!--  Original Target XPath:     -->
      <!--  Could not determine target element or attribute name:  <>  -->
      <!--  Could not determine target element or attribute name:  </>  -->
      <refnum>
        <xsl:attribute name="refnumscheme">UCN</xsl:attribute>
        <xsl:attribute name="num" select="node()"/>
      </refnum>
    </xsl:template>
    Template refnum/@ln.user-displayed
    Namespace No namespace
    Match refnum/@ln.user-displayed
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="refnum/@ln.user-displayed"/>
    Template lnlink[@service='SEARCH']
    Documentation

    Description

    When lnlink[@service="SEARCH"] occurs it is suppressed. The service type "SEARCH" is not supported in New Lexis. It is recommended that lnlink elements with @service="SEARCH" be copied as is into an XML comment. This retains the content for future analysis without creating unsupported target markup. The risk of this approach is the non-conversion of any marker/display text that is within the lnlink and the consequent lack of this text being displayed in NewLexis products.

    Source XML showing service type "SEARCH" converted to XML comment.

    
    <lnlink scope="All Subscribed Australian Cases and Commentary" scope-protocol="combined-source-name" service="SEARCH" status="valid">
    	<api-params>
    		<param name="expressSearch" value="true"/>
    		<param name="searchString" value="ELECTRICITY SAFETY ACT 1998 w/s LEG-REF(1)"/>
    	</api-params>
    </lnlink>
    
    	

    Target XML

    
    
    <!--  lnlink[@service="SEARCH"] source:
    
    <lnlink scope="All Subscribed Australian Cases and Commentary" scope-protocol="combined-source-name" service="SEARCH" status="valid">
    	<api-params>
    		<param name="expressSearch" value="true"/>
    		<param name="searchString" value="ELECTRICITY SAFETY ACT 1998 w/s LEG-REF(1)"/>
    	</api-params>
    </lnlink>
    
    -->
    
    
    	

    Description

     Awantika: not in GDS 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_abbrvname_ln.user-displayed.dita"/> 
    <xsl:include href="../../modules/nonamespace/Rosetta_abbrvname_ln.user-displayed.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_case.courtcode_ln.user-displayed.dita"/> -\->
    	<xsl:include href="../../modules/nonamespace/Rosetta_case.courtcode_ln.user-displayed.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refnum_ln.user-displayed.dita"/> -\->
    	
    	<!-\- <topicref href="../../common_newest/Rosetta_case.juris_ln.user-displayed.dita"/> -\->
    	<xsl:include href="../../modules/nonamespace/Rosetta_case.juris_ln.user-displayed.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     end topichead  ln.user_displayed  
     start topichead  lnlink  
     <topicref href="../../common_newest/Rosetta_lnlink_service_SEARCH-LxAdv-SUPPRESS.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_lnlink_service_SEARCH-LxAdv-SUPPRESS.dita  
    Namespace No namespace
    Match lnlink[@service='SEARCH']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lnlink[@service='SEARCH']">
      <xsl:comment>
        <xsl:copy-of select="."/>
      </xsl:comment>
    </xsl:template>
    Template lnlink[@service='ATTACHMENT']/marker
    Documentation

    Description

    lnlink[@service="ATTACHMENT"] becomes ref:lnlink[@service="ATTACHMENT"], and its child elements are transformed as follows:

    • The attribute lnlink/@status is always suppressed, it is never output to the target document.
    • lnlink/marker becomes ref:lnlink/ref:marker, with attribute marker/@role becoming ref:marker/@role if present
    • create ref:lnlink/ref:locator and populate as follows:
      • if and only if there is an lnlink/api-params/param where param/@name="attachment-key", then this param becomes ref:locator/ref:key-name/@name="attachment-key", then a ref:key-value element is also created, and the attribute param/@value becomes ref:locator/ref:key-value/@value.
      • otherwise lnlink/api-params> becomes ref:locator/ref:locator-params, and its child elements are transformed as follows:
        • all other api-params/param elements ( with the exception of param/@name="attachment-key") become ref:locator-params/proc:param, with attribute param/@name becoming proc:param/@name and attribute param/@value becoming proc:param/@value.

    Source XML

    
    <lnlink service="ATTACHMENT" status="valid">
      <marker role="content">PDF Format</marker>
      <api-params>
        <param name="attachment-key" value="application_for_apportionment-xxxx-xxxx-xxxxx-xx"/>
        <param name="attachment-type" value="pdf"/>
        <param name="attachment-smi" value="4364"/>
        <param name="componentseq" value="1"/>
      </api-params>
    </lnlink>
                    
                

    Target XML 3

    
    <ref:lnlink service="ATTACHMENT">
      <ref:marker role="content">PDF Format</ref:marker>
      <ref:locator>
       <ref:locator-key>
        <ref:key-name name="attachment-key"/>
        <ref:key-value value="application_for_apportionment-xxxx-xxxx-xxxxx-xx"/>
       </ref:locator-key>
       <ref:locator-params>
        <proc:param name="componentseq" value="1"/>
        <proc:param name="attachment-type" value="PDF"/>
        <proc:param name="attachment-smi" value="4364"/>
       </ref:locator-params>
      </ref:locator>
    </ref:lnlink>
                    
                

    Description

     <topicref href="../../common_newest/Rosetta_lnlink_service_ATTACHMENT-LxAdv-ref.lnlink.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_lnlink_service_ATTACHMENT-LxAdv-ref.lnlink.dita  
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT']/marker
    Mode #default
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="lnlink[@service='ATTACHMENT']/marker" priority="2">
      <ref:marker>
        <xsl:apply-templates select="@*|node()"/>
      </ref:marker>
    </xsl:template>
    Template lnlink[@service='ATTACHMENT']/marker/@role
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT']/marker/@role
    Mode #default
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="lnlink[@service='ATTACHMENT']/marker/@role" priority="2">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template lnlink[@service='ATTACHMENT']/@status
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT']/@status
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lnlink[@service='ATTACHMENT']/@status"/>
    Template lnlink[@service='ATTACHMENT'][not(parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp)]
    Documentation
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT'][not(parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp)]
    Mode #default
    References
    Import precedence 0
    Source
    Template lnlink[@service='ATTACHMENT'][not(parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp)][$streamID=('NZ11','AU10','USLPA')]/api-params
    Documentation
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT'][not(parent::docinfo:assoc-links or parent::docinfo:assoc-links-grp)][$streamID=('NZ11','AU10','USLPA')]/api-params
    Mode #default
    References
    Import precedence 0
    Priority 2
    Source
    Template lnlink[@service='ATTACHMENT']/api-params
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT']/api-params
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lnlink[@service='ATTACHMENT']/api-params">
      <ref:locator-params>
        <xsl:apply-templates/>
        <xsl:if test="parent::lnlink[@service='ATTACHMENT']">
          <proc:param>
            <xsl:attribute name="name">attachment-smi</xsl:attribute>
            <xsl:attribute name="value"/>
            <xsl:message>need SMI from CSSM? Is this a parameter?</xsl:message>
          </proc:param>
        </xsl:if>
      </ref:locator-params>
    </xsl:template>
    Template lnlink[@service='ATTACHMENT']/api-paramsparam
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT']/api-paramsparam
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lnlink[@service='ATTACHMENT']/api-paramsparam">
      <xsl:if test="@name!='attachment-key'">
        <proc:param>
          <xsl:apply-templates select="@name | @value"/>
        </proc:param>
      </xsl:if>
    </xsl:template>
    Template lnlink[@service='ATTACHMENT']/api-paramsparam/@name | lnlink[@service='ATTACHMENT']/api-paramsparam/@value
    Namespace No namespace
    Match lnlink[@service='ATTACHMENT']/api-paramsparam/@name | lnlink[@service='ATTACHMENT']/api-paramsparam/@value
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="lnlink[@service='ATTACHMENT']/api-paramsparam/@name | lnlink[@service='ATTACHMENT']/api-paramsparam/@value">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template marker
    Documentation

    Description

    marker becomes ref:marker.


    Description

     end topichead  lnlink  
     start topichead  marker  
     <topicref href="../../common_newest/Rosetta_marker-LxAdv-ref.marker.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_marker-LxAdv-ref.marker.dita  
    Namespace No namespace
    Match marker
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="marker">
      <ref:marker>
        <xsl:apply-templates select="@* | node()"/>
      </ref:marker>
    </xsl:template>
    Template marker[inlineobject]
    Documentation

    Description

    marker is suppressed if it contains inlineobject as a child element.

    Source XML

    
    <lnlink status="valid" service="SEARCH" scope="All Subscribed Australian Cases and Commentary" scope-protocol="combined-source-name">
        <marker>
            <inlineobject width="21px" type="image" filename="mb.gif" attachment="web-server" alttext="click to find cases &amp; commentary"/>
        </marker>
        <api-params>
            <param name="expressSearch" value="true"/>
            <param name="searchString" value="SUPREME COURT RULES 1970"/>
        </api-params>
    </lnlink>
    
                

    Suppress marker. A corresponding product requirement should be created with an instruction to instantiate the image on retrieval based on information/semantic markup in the document.


    Description

     <topicref href="../../common_newest/Rosetta_marker_inlineobject-LxAdv-SUPPRESS.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_marker_inlineobject-LxAdv-SUPPRESS.dita  
     JL WE NEED TO RESOLVE THIS INLINEOBJECT ISSUE !!!!! 
    Namespace No namespace
    Match marker[inlineobject]
    Mode #default
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="marker[inlineobject]" priority="25"/>
    Template nl
    Documentation

    Description

    nl becomes proc:nl

    Note: nl comes with @n then @n will be suppressed in NL conversion.

    Note: MLV: NSW Law reports - preserve spacing and linebreaks for licensing.

    Source XML

    <tbody>
        <row>
            <entry colname="c1" align="left">On the day after this Regulation's notification
                day.<nl/>(4/11/2008)</entry>
        </row>
    </tbody>
        	

    Target XML

    <tbody>
        <row>
            <entry colname="c1" align="left">On the day after this Regulation's notification
                day.<proc:nl/>(4/11/2008)</entry>
        </row>
    </tbody>
    
        	

    Source XML

    <p>
        <text>
            <nl n="2"/>
        </text>
    </p>
          

    Target XML

    <p>
        <text>
            <proc:nl/>
        </text>
    </p>
    

    Description

    JL This is what I envision in the future:
            
     <xsl:template match="marker[inlineobject]" priority="25">
            <xsl:apply-templates select="inlineobject" mode="to-be-determined"/>
        </xsl:template> 
     end topichead  marker  
     rosetta element: nl 
     <topicref href="../../common_newest/Rosetta_nl-LxAdv-proc.nl.dita"/> 
     Awantika:2017-11-30- CI has differnt rule for CA02CC,DC and DS."Any nl elements that occur inside case:casename should be suppressed if they are preceded or followed by a space. Any nl elements that
    are not preceded or followed by a space should be converted into a single space character. Webstar# 6994049" 
    Namespace No namespace
    Match nl
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="nl">
      <xsl:choose>
        <!-- Awantika: Commenting this for CA02CC.Webstar  6994049. CI doesn't say to create proc:nl
                    "Any nl elements that occur inside case:casename should be suppressed if they are preceded or followed by a space. Any nl elements that
    are not preceded or followed by a space should be converted into a single space character."
                    -->
        <xsl:when test="$streamID='CA02CC' and parent::case:casename">
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:when test="$streamID='AU21'">
          <xsl:choose>
            <xsl:when test="parent::text/parent::p/parent::source_dict:subtopic/@id[starts-with(.,'BOOK:')]"/>
            <xsl:otherwise>
              <xsl:element name="proc:nl">
                <xsl:apply-templates/>
              </xsl:element>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <xsl:otherwise>
          <xsl:element name="proc:nl">
            <xsl:apply-templates/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template nl/@n
    Namespace No namespace
    Match nl/@n
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="nl/@n">
      <!-- suppress -->
    </xsl:template>
    Template num
    Documentation

    Description

    num becomes num

    Source XML

    
    <h align="left">
    <num>103</num>
    <emph typestyle="bf">Introduction</emph>
    </h>
    
    	

    Target XML

    
    <h align="left">
    <num>103</num>
    <emph typestyle="bf">Introduction</emph>
    </h>
    
    	

    Description

     start topichead  num_frac  
     <topicref href="../../common_newest/Rosetta_num-LxAdv-num.dita"/> 
     PS: templated created for num conversion 
    Namespace No namespace
    Match num
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="num">
      <num>
        <xsl:apply-templates select="node()"/>
      </num>
    </xsl:template>
    Template num/@searchtype
    Documentation

    Description

     Awnatika:2017-11-20- Webstar# 7043263- Suppressed @searchtype. 
    Namespace No namespace
    Match num/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="num/@searchtype"/>
    Template frac[parent::num or ancestor::formula or ancestor::dispformula or parent::fracor or parent::frac]
    Documentation

    Description

    frac becomes frac. The output frac must be within a num or formula ancestor element (one of these does not have to be an immediate parent, just an ancestor). If the output frac does not have such an ancestor, then a parent num element must be created to contain the frac.

    Within frac the child numer becomes numer and the child denom becomes denom. Both numer and denom are required children of frac.

    Source XML where num occurs as parent of frac

    
    <p><text>...<num>
    <frac>
    	<numer>2</numer>
    	<denom>5</denom>
    </frac>
    </num>...</text></p>
    
    	

    Target XML

    
    <p><text>...<num>
    <frac>
    	<numer>2</numer>
    	<denom>5</denom>
    </frac>
    </num>...</text></p>
    
    	

    Source XML where frac occurs outside of num (has no ancestor that is num)

    
    <p><text>Given the ratio
    <frac>
    	<numer>3</numer>
    	<denom>7</denom>
    </frac> then the ...</text></p>
    
    	

    Target XML

    
    <p><text>Given the ratio 
    <num>
    <frac>
    	<numer>3</numer>
    	<denom>7</denom>
    </frac>
    </num> then the ...</text></p>
    
    	

    Source XML where emph occurs as parent of frac and the frac itself contains a nested frac.

    
    <title>...<emph>
    <!-- This is the outer <frac>. -->
    <frac>
     <numer>
        <!-- This is a nested <frac>. -->
       <frac>
         <numer>3</numer>
         <denom>8</denom>
       </frac>
     </numer>
     <denom>7</denom>
    </frac>
    </emph>...</title>
    
    	

    Target XML

    
    <emph>
    <!-- 
          This <num> is created to contain the outer <frac>, 
          since otherwise this <frac> would have no ancestor that is <num>.
    -->
    <num>
    <frac>
     <numer>
        <!-- 
              Note the nested <frac> is not wrapped in another <num>, 
              since it already has an ancestor that is <num>. 
        -->
       <frac>
         <numer>3</numer>
         <denom>8</denom>
       </frac>
     </numer>
     <denom>7</denom>
    </frac>
    </num>
    </emph>
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_frac-LxAdv-num_frac.dita"/> 
     2017-10-04 - MDS: added 'or parent:fracor' to match modified monolith. 
     2017-10-06 - JL: added 'or parent:frac' to match modified monolith for HK01. 
    Namespace No namespace
    Match frac[parent::num or ancestor::formula or ancestor::dispformula or parent::fracor or parent::frac]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="frac[parent::num or ancestor::formula or ancestor::dispformula or parent::fracor or parent::frac]">
      <!--  Original Target XPath:  num/frac   -->
      <frac>
        <xsl:apply-templates select="@* | node()"/>
      </frac>
    </xsl:template>
    Template frac[not(parent::num or ancestor::formula or ancestor::dispformula or parent::frac)]
    Namespace No namespace
    Match frac[not(parent::num or ancestor::formula or ancestor::dispformula or parent::frac)]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="frac[not(parent::num or ancestor::formula or ancestor::dispformula or parent::frac)]">
      <!--  Original Target XPath:  num/frac   -->
      <num>
        <frac>
          <xsl:apply-templates select="@* | node()"/>
        </frac>
      </num>
    </xsl:template>
    Template numer
    Namespace No namespace
    Match numer
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="numer">
      <!--  Original Target XPath:  numer   -->
      <numer>
        <xsl:apply-templates select="@* | node()"/>
      </numer>
    </xsl:template>
    Template denom
    Namespace No namespace
    Match denom
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="denom">
      <!--  Original Target XPath:  denom   -->
      <denom>
        <xsl:apply-templates select="@* | node()"/>
      </denom>
    </xsl:template>
    Template org
    Documentation

    Description

    org becomes entity:org.

    Source XML

    
    <p>
     <text>
      <org>Judges Chambers</org>
     </text>
    </p>
    
    	

    Target XML

    
    <p>
     <text>
      <entity:org>Judges Chambers</entity:org>
     </text>
    </p>
    
    	

    Description

     end topichead  num_frac  
     Rosetta element: org 
     <topicref href="../../common_newest/Rosetta_org-to-LexisAdvance_entity_org.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_org-to-LexisAdvance_entity_org.dita  
     BRT: the following template is in entity.xsl, match="org" in xsl:otherwise choice. I did not split this out in entity.xsl - left 'as is' 
    Namespace No namespace
    Match org
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="org">
      <xsl:element name="entity:org">
        <xsl:apply-templates/>
      </xsl:element>
    </xsl:template>
    Template org[child::remotelink][parent::contrib[parent::comm:info]]
    Documentation

    Description

     Vikas Rohilla : Template to match the org 
    Namespace No namespace
    Match org[child::remotelink][parent::contrib[parent::comm:info]]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="org[child::remotelink][parent::contrib[parent::comm:info]]">
      <xsl:apply-templates select="@*|node()"/>
    </xsl:template>
    Template p
    Documentation

    Description

    Except where otherwise noted, p becomes p comes with @indent becomes @indent. @indent has tokenized value in NewLexis schema. And p/@style becomes p/@align. @align has tokenized value in NewLexis Schema.

    Source XML

     <blockquote> <p indent="hang"> <text>Note: There is no
                        penalty for this Rule.</text></p> </blockquote> 

    Target XML

     <blockquote> <p indent="hang"> <text>Note: There is no
                        penalty for this Rule.</text> </p> </blockquote> 

    Note: If p comes with @i then @i will get dropped in NewLexis.

    Source XML

     <blockquote> <p i="3.5" indent="hang"> <text>Note:
                        There is no penalty for this Rule.</text></p> </blockquote>
                    

    Target XML

     <blockquote> <p indent="hang"> <text>Note: There is no
                        penalty for this Rule.</text> </p> </blockquote> 

    Note: If p comes with @nl this means the p should start with the same number of proc:nl elements before any text content in order to maintain vertical white space.

    Source XML

     <p nl="1"> <text> <emph typestyle="bf">EDITORIAL
                        NOTE</emph> ... </text> </p> 

    Target XML

     <p> <text> <proc:nl/> <emph
                        typestyle="bf">EDITORIAL NOTE</emph> ... </text> </p>
                    

    Note: If p comes with @nl=”0”, this means the first <nl/> encountered within the <p> should be omitted.

    Source XML

     <p nl="0"> <text> <nl/> <ci:cite
                        searchtype="LEG-REF"> <ci:content>Companies Code (NSW)
                        s129</ci:content> </ci:cite> </text> </p> 

    Target XML

     <p> <text> <lnci:cite> <lnci:content>Companies
                        Code (NSW) s129</lnci:content> </lnci:cite> </text> </p>
                    

    Source XML

     <p style="right"> <text><emph typestyle="it">Last
                        updated: June 2011</emph></text> </p> 

    Target XML

     <p align="right"> <text><emph typestyle="it">Last
                        updated: June 2011</emph></text> </p> 

    Exceptional scenario for NZ07-Linxplus

    If p or p/@nl="0" is a child of references element then merge all p or p/@nl="0" in a single p in target. Also all occurences of nl within text becomes proc:nl. Refer below example.

    Source XML

     <references referencetype="statutes"> <p> <text>
                        <process-ignore process="kwd"> <emph typestyle="bf">References to
                        Legislation</emph> </process-ignore> </text> </p> <p
                        nl="0"> <text><ci:cite
                        searchtype="LEG-REF"><ci:content><citefragment
                        searchtype="LEG-NAME-REF"><remotelink service="DOC-ID" dpsi="0069"
                        remotekey1="REFPTID" refpt="2000A38">Bail Act
                        2000</remotelink></citefragment></ci:content></ci:cite>
                        <ci:cite searchtype="LEG-REF"><ci:content><citefragment
                        searchtype="LEG-PROV-REF"><remotelink service="DOC-ID" dpsi="0069"
                        remotekey1="REFPTID"
                        refpt="2000A38S8">s8</remotelink></citefragment></ci:content></ci:cite>,
                        <ci:cite searchtype="LEG-REF"><ci:content><citefragment
                        searchtype="LEG-PROV-REF"><remotelink service="DOC-ID" dpsi="0069"
                        remotekey1="REFPTID" refpt="2000A38S13"
                        >s13</remotelink></citefragment></ci:content></ci:cite></text>
                        </p> <p nl="0"> <text> <nl/> <ci:cite
                        searchtype="LEG-REF"> <ci:content> <citefragment
                        searchtype="LEG-NAME-REF"> <remotelink service="DOC-ID" dpsi="0069"
                        remotekey1="REFPTID" refpt="1975A116">Misuse of Drugs Act
                        1975</remotelink> </citefragment> </ci:content>
                        </ci:cite> </text> </p> <p nl="0"> <text>
                        <nl/> <ci:cite searchtype="LEG-REF"> <ci:content>
                        <citefragment searchtype="LEG-NAME-REF"> <remotelink service="DOC-ID"
                        dpsi="0069" remotekey1="REFPTID" refpt="2002A9">Sentencing Act
                        2002</remotelink> </citefragment> </ci:content>
                        </ci:cite> <ci:cite searchtype="LEG-REF"> <ci:content>
                        <citefragment searchtype="LEG-PROV-REF"> <remotelink service="DOC-ID"
                        dpsi="0069" remotekey1="REFPTID" refpt="2002A9S65">s65</remotelink>
                        </citefragment> </ci:content> </ci:cite> </text>
                        </p> </references> 

    Target XML

     <ref:relatedrefs referencetype="statutes"> <bodytext>
                        <p> <text> <emph typestyle="bf">References to
                        Legislation</emph> </text> <text> <lnci:cite
                        type="legislation"> <lnci:content> <ref:crossreference
                        crossreferencetype="seeAlso"> <ref:content>Bail Act
                        2000</ref:content> <ref:locator> <ref:locator-key>
                        <ref:key-name name="DOC-ID"/> <ref:key-value value="0069-2000A38"/>
                        </ref:locator-key> </ref:locator> </ref:crossreference>
                        </lnci:content> </lnci:cite> <lnci:cite type="legislation">
                        <lnci:content> <ref:crossreference crossreferencetype="seeAlso">
                        <ref:content>s8</ref:content> <ref:locator>
                        <ref:locator-key> <ref:key-name name="DOC-ID"/> <ref:key-value
                        value="0069-2000A38S8"/> </ref:locator-key> </ref:locator>
                        </ref:crossreference> </lnci:content> </lnci:cite>,
                        <lnci:cite type="legislation"><lnci:content> <ref:crossreference
                        crossreferencetype="seeAlso"> <ref:content>s13</ref:content>
                        <ref:locator> <ref:locator-key> <ref:key-name name="DOC-ID"/>
                        <ref:key-value value="0069-2000A38S13"/> </ref:locator-key>
                        </ref:locator> </ref:crossreference> </lnci:content>
                        </lnci:cite> <proc:nl/> <lnci:cite type="legislation">
                        <lnci:content> <ref:crossreference crossreferencetype="seeAlso">
                        <ref:content>Misuse of Drugs Act 1975</ref:content>
                        <ref:locator> <ref:locator-key> <ref:key-name name="DOC-ID"/>
                        <ref:key-value value="0069-1975A116"/> </ref:locator-key>
                        </ref:locator> </ref:crossreference> </lnci:content>
                        </lnci:cite> <proc:nl/> <lnci:cite type="legislation">
                        <lnci:content> <ref:crossreference crossreferencetype="seeAlso">
                        <ref:content>Sentencing Act 2002</ref:content> <ref:locator>
                        <ref:locator-key> <ref:key-name name="DOC-ID"/> <ref:key-value
                        value="0069-2002A9"/> </ref:locator-key> </ref:locator>
                        </ref:crossreference> </lnci:content> </lnci:cite>
                        <lnci:cite type="legislation"> <lnci:content> <ref:crossreference
                        crossreferencetype="seeAlso"> <ref:content>s65</ref:content>
                        <ref:locator> <ref:locator-key> <ref:key-name name="DOC-ID"/>
                        <ref:key-value value="0069-2002A9S65"/> </ref:locator-key>
                        </ref:locator> </ref:crossreference> </lnci:content>
                        </lnci:cite> </text> </p> </bodytext>
                        </ref:relatedrefs> 

    Note: If source document is having the input scenario "pgrp/p/leg:histnote" then conversion needs to drop 'p' markup in target conversion and target mapping xpath is "pgrp/note[@notetype="historical"]".

    Note: For Stream 'HK06'

    When the source has deflist/defitem/p/text then omit p/text and retain defitem.


    Description

     start topichead  p  
     <topicref href="../../common_newest/Rosetta_p-LxAdv-p.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_p-LxAdv-p.dita  
     BRT: this template is the otherwise condition in match="p" in base.xsl. 
                     The rules in this topic for handling @nl are different than the existing XSLT, which ignores and suppresses the element. 
                     Adding template match="p[@nl!='']/text" to handle this rule. *** Also, did not address NZ07 exception scenario** 
                     
           JL: seems like the @nl handling  will not behave properly unless we move it to the text template.  
            I moved it to XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_text-LxAdv-text-with-test-for-whitespace-content.xsl
            PLEASE LOOK THERE!!!!!! IF YOU NEED TO ADD IT TO ANOTHER MODULE FOR ELEMENT <text> WE MIGHT WANT TO FURTHER MODULARIZE IT 
    Namespace No namespace
    Match p
    Mode #default
    References
    Import precedence 0
    Source
    <xsl:template match="p">
      <xsl:variable name="docinfoidtext" select="/*/docinfo/docinfo:doc-id/text()"/>
      <xsl:choose>
        <!-- Priya Kaushal: Added below code for UK 15 -->
        <xsl:when test="parent::references[$streamID = 'UK15']">
          <bodytext>
            <p>
              <xsl:apply-templates select="@* | node()"/>
            </p>
          </bodytext>
        </xsl:when>
        <xsl:when test="parent::in:body[$streamID = 'AU16']">
          <p>
            <xsl:apply-templates select="node()"/>
          </p>
        </xsl:when>
        <xsl:when test="parent::in:body">
          <bodytext>
            <p>
              <xsl:apply-templates select="node()"/>
            </p>
          </bodytext>
        </xsl:when>
        <!-- Vikas Rohilla : Included for the stream UK12          -->
        <xsl:when test="parent::blockquote[$streamID = 'UK12']">
          <p>
            <xsl:apply-templates select="@* | refpt, node() except refpt"/>
          </p>
        </xsl:when>
        <xsl:when test="child::text/child::note[@notetype!='xref'][$streamID = 'UK12']">
          <xsl:apply-templates select="@* | refpt, node() except refpt"/>
        </xsl:when>
        <xsl:when test="(parent::frm:div                  | parent::frm:body                  | parent::clause[ancestor::frm:div | ancestor::frm:body]                  | parent::li[ancestor::frm:body and not(parent::l/parent::entry)])[not(ancestor::footnote or ancestor::note)]                 [$streamID = ('NZ11','AU10')]">
          <form:p>
            <xsl:if test="not(@style) and child::text[1]/@align[.!='']">
              <xsl:copy-of select="child::text[1]/@align"/>
            </xsl:if>
            <xsl:apply-templates select="@* | refpt, node() except refpt"/>
          </form:p>
        </xsl:when>
        <xsl:when test="(parent::frm:div | parent::frm:body | parent::clause[ancestor::frm:div | ancestor::frm:body] | parent::li[ancestor::frm:body])[not(ancestor::footnote or ancestor::note)][$streamID = 'UK12']">
          <form:p>
            <xsl:if test="not(@style) and child::text[1]/@align[.!='']">
              <xsl:copy-of select="child::text[1]/@align"/>
            </xsl:if>
            <xsl:apply-templates select="@* | refpt, node() except refpt"/>
          </form:p>
        </xsl:when>
        <xsl:when test="(parent::sigblock[ancestor::frm:div | ancestor::frm:body])[not(ancestor::footnote)][$streamID = 'UK12']">
          <form:line>
            <xsl:apply-templates select="@* | node()"/>
          </form:line>
        </xsl:when>
        <!-- MDS - occurs in HK04 -  child is leg:histnote then the p element is not output and simply passed through.-->
        <!-- JL revised to handle the many scenarios when p has other children than leg:histnote
                also revised to strip the p wrapper in certain conditions when legfragment is a child
                -->
        <xsl:when test="leg:histnote | blockquote[legfragment and not(child::*[2])][parent::p[parent::*:bodytext or parent::pgrp or parent::li or parent::fnbody or parent::glp:note or parent::case:judgmentbody or parent::case:appendix]]">
          <!--<xsl:apply-templates select="node()"/>-->
          <xsl:for-each-group select="*" group-adjacent="                     if (self::leg:histnote or self::blockquote[legfragment and not(child::*[2])][parent::p[parent::*:bodytext or parent::pgrp or parent::li or parent::fnbody or parent::glp:note or parent::case:judgmentbody or parent::case:appendix]]) then                             0                         else                             1">
            <xsl:choose>
              <xsl:when test="current-grouping-key() = 0">
                <xsl:apply-templates select="current-group()"/>
              </xsl:when>
              <!--Satbir: Added below template for changing order of reft before desig in NZ03 only-->
              <xsl:when test="$streamID = 'NZ03'">
                <p>
                  <xsl:apply-templates select="following-sibling::refpt[preceding-sibling::pnum]"/>
                  <xsl:for-each select="current-group()">
                    <xsl:apply-templates select="current() except self::refpt"/>
                  </xsl:for-each>
                </p>
              </xsl:when>
              <xsl:otherwise>
                <p>
                  <xsl:apply-templates select="parent::p/@*"/>
                  <xsl:if test="not(parent::p/@style)">
                    <xsl:copy-of select="parent::p/text[1]/@align"/>
                  </xsl:if>
                  <!-- MDS 2017-08-08 Added handling for refpt to reorder in output-->
                  <xsl:apply-templates select="current-group()[self::refpt]"/>
                  <xsl:for-each select="current-group()">
                    <xsl:apply-templates select=". except(self::refpt)"/>
                  </xsl:for-each>
                </p>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each-group>
        </xsl:when>
        <!-- JL: funky NZ07 case where we collapse p or p[@nl='0'] element children of references 
                full logic isn't given but I assume we don't do the collapse if the reference has any non-p children or if 
                references has any p children where the @nl value is not zero or we're going to be here all year -->
        <xsl:when test="parent::references[not(child::*[not(self::p[@nl = '0' or not(@nl)])])] and starts-with($streamID, 'NZ07') and (not(@nl) or @nl = '0') and not(preceding-sibling::p)">
          <xsl:element name="p" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
            <!-- JL this "if" condition that moves text align att value to the parent p is generic and cannot be used for CA -->
            <xsl:apply-templates select="@*"/>
            <xsl:if test="not(@style) and child::text[@align[. != '']] and not(child::text[2]) and not(starts-with($streamID, 'CA'))">
              <xsl:attribute name="align">
                <xsl:value-of select="text/@align"/>
              </xsl:attribute>
            </xsl:if>
            <!-- JL: the sample seems to indicate they want to collapse some of the text child elements too, 
                            but doesn't give the logic for doing that so I'm GUESSING based on the sample!
                            My guess at the logic used: if the @nl has the same value as (or is missing the same as) the previous p, then collapse 
                            text element children too.                          
                            This needs to be very carefully tested when we test  NZ07 data.
                        
                        -->
            <xsl:choose>
              <xsl:when test="child::*[not(self::text)] or following-sibling::p[child::*[not(self::text)]]">
                <xsl:apply-templates select="refpt | following-sibling::p/refpt"/>
                <xsl:apply-templates select="*[not(self::refpt)] | text()"/>
                <!-- if any p elements have ANY child elements other than <text>, don't merge child text nodes. cleaner -->
                <xsl:for-each select="following-sibling::p">
                  <xsl:apply-templates select="*[not(self::refpt)] | text()"/>
                </xsl:for-each>
              </xsl:when>
              <xsl:otherwise>
                <!-- can assume p has only text children, yay! And we have also whittled the possibilities down to "p contains an nl att or not" -->
                <xsl:for-each-group select="self::p | following-sibling::p" group-adjacent="exists(@nl)">
                  <xsl:element name="text" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
                    <xsl:apply-templates select="current-group()[1]/text[1]/@*"/>
                    <xsl:for-each select="current-group()">
                      <xsl:apply-templates select="text/node()"/>
                    </xsl:for-each>
                  </xsl:element>
                </xsl:for-each-group>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:element>
        </xsl:when>
        <!-- suppresses context nodes already accessed in previous condition -->
        <xsl:when test="parent::references[not(child::*[not(self::p[@nl = '0' or not(@nl)])])] and starts-with($streamID, 'NZ07') and (not(@nl) or @nl = '0') and preceding-sibling::p"/>
        <xsl:when test="starts-with($streamID, 'CA') and count(text) > 1 and not(@style) and text[@align]">
          <xsl:for-each-group select="*" group-adjacent="concat('', @align)">
            <xsl:element name="p" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
              <xsl:apply-templates select="parent::p/@*"/>
              <xsl:copy-of select="@align"/>
              <xsl:for-each select="current-group()">
                <xsl:apply-templates select="."/>
              </xsl:for-each>
            </xsl:element>
          </xsl:for-each-group>
        </xsl:when>
        <!-- Awantika: conditional change for AU20, using double slashes as full path is not working here  -->
        <xsl:when test="//source_cttr:annotations/child::heading/note/h[. = 'ActName' or . = 'Act Name'] and $streamID = 'AU20'">
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:when test="parent::bodytext[$streamID = 'CA12']">
          <p>
            <xsl:if test="child::text/ci:cite[not(preceding::p/text/ci:cite)] and not(child::text/@searchtype='CASE-NAME')">
              <ref:anchor>
                <xsl:attribute name="id">dict-CASENAME-CITE</xsl:attribute>
                <xsl:attribute name="anchortype">local</xsl:attribute>
              </ref:anchor>
            </xsl:if>
            <xsl:apply-templates select="node()"/>
          </p>
        </xsl:when>
        <!-- 2017-10-17 - MDS: Added due to Webstar 7025682 -->
        <xsl:when test="parent::l[$streamID='UK12']">
          <listitem>
            <bodytext>
              <p>
                <xsl:apply-templates select="@* | node()"/>
              </p>
            </bodytext>
          </listitem>
        </xsl:when>
        <xsl:when test="$streamID='UK22CF' and parent::legfragment and (preceding-sibling::leg:prelim or preceding-sibling::leg:info)">
          <xsl:element name="primlaw:bodytext">
            <xsl:element name="p">
              <xsl:apply-templates select="refpt"/>
              <xsl:apply-templates select="*[not(self::refpt)] | text()"/>
            </xsl:element>
          </xsl:element>
        </xsl:when>
        <xsl:when test="$streamID='HK07' and parent::bodytext[parent::level[@leveltype='prec' or @leveltype='prec.grp' or @leveltype='precgrp' or @leveltype='precgrp1' or @leveltype='precgrp2' or parent::comm.chap or ancestor::level[@leveltype = 'prec.grp']]]">
          <form:p>
            <xsl:apply-templates select="node() except inlineobject"/>
          </form:p>
        </xsl:when>
        <!--    <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'overview') and ancestor::source_cttr:annotations[not(@annotgroup='prov-al')]/heading/note[descendant::lnlink/marker['List of Provisions' or 'Defined Terms' or 'Government Website'][not(@id='OI13')]] | source_cttr:annotations[not(@annotgroup='prov-al')]/heading/remotelink">
                    <xsl:apply-templates/>
                </xsl:when>-->
        <xsl:otherwise>
          <xsl:choose>
            <!-- Awantika: 2017-10-26- Added the condition to check multiple text/@align in one p
                       as per CI instructions which is currently only for Canada applying for HK07. 
                       Creating seperate <p> for each text/@align.-->
            <xsl:when test="count(child::text/@align) >= 1 and $streamID='HK07'">
              <xsl:for-each select="child::*">
                <xsl:element name="p">
                  <xsl:if test="self::*[1]/@align">
                    <xsl:attribute name="align">
                      <xsl:value-of select="self::*[1]/@align"/>
                    </xsl:attribute>
                  </xsl:if>
                  <xsl:apply-templates select="self::*"/>
                </xsl:element>
              </xsl:for-each>
            </xsl:when>
            <!-- Awantika:2017-10-27: p/text will be converted to <textitem> for AU20 for specific scenario -->
            <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'history') and /CITATORDOC/source_cttr:body/source_cttr:content/source_cttr:annotations/heading/note[@id='HI4']| /CITATORDOC/source_cttr:body/source_cttr:content/source_cttr:annotations/heading/title[.='Assent']">
              <xsl:apply-templates select="@* | node()"/>
            </xsl:when>
            <!--Satbir: Added mdule for handling glp:note under p/text-->
            <xsl:when test="$streamID='NZ03' and child::text/child::glp:note[not(child::node except glp:note)][ancestor::case:judgmentbody]">
              <xsl:apply-templates select="child::text/child::glp:note"/>
            </xsl:when>
            <!-- Awntika: 2017-12-13- Updated for webstar# 7065522 -->
            <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'overview') and parent::note[ancestor::source_cttr:annotations[@id='OI2']/heading/title[.,'Former Title']]">
              <xsl:apply-templates select="node()"/>
            </xsl:when>
            <xsl:otherwise>
              <p>
                <!-- JL this "if" condition that moves text align att value to the parent p is generic and cannot be used for CA -->
                <xsl:apply-templates select="@*"/>
                <!-- <xsl:if
                            test="not(@style) and child::text[@align[. != '']] and not(child::text[2]) and not(starts-with($streamID, 'CA'))">
                            <xsl:attribute name="align">
                                <xsl:value-of select="text/@align"/>
                            </xsl:attribute>
                        </xsl:if>-->
                <!--                   Chaitanya :Making the for the P/@align as CA08 require this change, Luckabaugh, Joy H. (LNG-HBE) <Joy.Luckabaugh@lexisnexis.com> has approved to change this module  -->
                <xsl:if test="not(@style) and child::text[@align[. != '']] and not(child::text[2])">
                  <xsl:attribute name="align">
                    <xsl:value-of select="text/@align"/>
                  </xsl:attribute>
                </xsl:if>
                <!-- JD: 2017-07-25: modifying the above for NZ18 create @align from only the first text/align so as to not concat -->
                <xsl:if test="not(@style) and child::text[@align[. != '']]                    and $streamID=('NZ18','AU04','NZ13')">
                  <xsl:attribute name="align">
                    <!-- take the @align from the first child <text> (don't concatenate all child text/@align values) -->
                    <xsl:value-of select="text[1]/@align"/>
                  </xsl:attribute>
                </xsl:if>
                <!-- Vikas Rohilla : Created desig altdesig before other element to meet schema ordering                  -->
                <!-- create ref:anchor before other elements to meet schema ordering -->
                <xsl:if test="not($streamID=('UK06','UK07'))">
                  <xsl:apply-templates select="(refpt | text/refpt), edpnum, pnum"/>
                </xsl:if>
                <!-- the above is the wrong order for legis and regulation if pnum goes to desig and edpnum goes to altdesig  -->
                <xsl:if test="$streamID=('UK06','UK07')">
                  <xsl:apply-templates select="(refpt | text/refpt), pnum, edpnum"/>
                </xsl:if>
                <!-- JD: 2017-07-31: added loop in order to properly wrap p/link elements and proces other children when present -->
                <xsl:for-each select="*">
                  <xsl:choose>
                    <!--SS: Added this condition for p/link becomes p/text/ref:lnlink - HK07-->
                    <!-- JD: 2017-07-28: this produces an extra <text> when there is a child <link> AND a child <text>;
                    		adding "and not(child::text)" -->
                    <xsl:when test="self::link">
                      <xsl:element name="text">
                        <!--<xsl:apply-templates />-->
                        <xsl:call-template name="generic-link"/>
                      </xsl:element>
                      <!--SS: Added "except link" condition for handling p/link - HK07-->
                      <!--<xsl:apply-templates
                    					select="*[not(self::refpt | self::edpnum | self::pnum)] except link | text()"/>-->
                    </xsl:when>
                    <!--SS: Added template for converting images from inline to figure/inline-->
                    <xsl:when test="child::inlineobject[$streamID='AU18']">
                      <text>
                        <xsl:apply-templates/>
                      </text>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:apply-templates select=".[not(self::refpt | self::edpnum | self::pnum)]"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:for-each>
                <!-- Vikas Rohilla : Created desig altdesig before other element to meet schema ordering                  -->
                <!-- create ref:anchor before other elements to meet schema ordering -->
                <!--<xsl:apply-templates select="(refpt | text/refpt), edpnum, pnum"/>
                        <!-\-SS: Added "except link" condition for handling p/link - HK07-\->
                    	<!-\- JD: removing 'except link' -\->
                    		<xsl:apply-templates
                    			select="*[not(self::refpt | self::edpnum | self::pnum)] except link | text()"/>-->
                <xsl:if test="note[@notetype='xref'] and $streamID='UK11DN'">
                  <xsl:for-each-group select="*" group-adjacent="if (self::note) then 1 else 0">
                    <xsl:choose>
                      <xsl:when test="current-grouping-key()=1">
                        <!--  <xsl:apply-templates select="ancestor::p/text"/>-->
                        <text>
                          <marginnote>
                            <ref:anchor>
                              <xsl:attribute name="id">
                                <xsl:value-of select="generate-id()"/>
                              </xsl:attribute>
                              <xsl:attribute name="anchortype">
                                <xsl:text>local</xsl:text>
                              </xsl:attribute>
                            </ref:anchor>
                            <bodytext>
                              <xsl:for-each select="current-group()">
                                <xsl:apply-templates select="@* | node()"/>
                              </xsl:for-each>
                            </bodytext>
                          </marginnote>
                        </text>
                      </xsl:when>
                    </xsl:choose>
                  </xsl:for-each-group>
                </xsl:if>
              </p>
            </xsl:otherwise>
          </xsl:choose>
          <xsl:for-each select="following-sibling::level">
            <xsl:call-template name="following_p_level"/>
          </xsl:for-each>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template p/@i
    Namespace No namespace
    Match p/@i
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p/@i">
      <!-- suppress -->
    </xsl:template>
    Template p/@nl
    Namespace No namespace
    Match p/@nl
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p/@nl">
      <!-- suppress -->
      <!-- see module for handling text when parent p has @nl -->
    </xsl:template>
    Template p/@ln.nsprefix
    Namespace No namespace
    Match p/@ln.nsprefix
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p/@ln.nsprefix">
      <!-- suppress -->
    </xsl:template>
    Template p/@class
    Namespace No namespace
    Match p/@class
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p/@class">
      <!-- suppress -->
    </xsl:template>
    Template p/@style
    Namespace No namespace
    Match p/@style
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p/@style">
      <xsl:choose>
        <xsl:when test=". = 'right' or . = 'left' or . = 'center'">
          <xsl:attribute name="align">
            <xsl:value-of select="."/>
          </xsl:attribute>
        </xsl:when>
        <xsl:otherwise>
          <xsl:message>'p' element 'style' attribute has unexpected and unmappable value
            <xsl:value-of select="."/>and will be omitted on output.</xsl:message>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template p[parent::glp:note[parent::text]][$streamID = 'CA01' or $streamID = 'CA02CC' or $streamID = 'CA04']
    Documentation

    Description

     Vikas Rohilla : Added template for the streamID CA01   
     Sudhanshu Srivastava : Added streamID CA02CC 
    Namespace No namespace
    Match p[parent::glp:note[parent::text]][$streamID = 'CA01' or $streamID = 'CA02CC' or $streamID = 'CA04']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="p[parent::glp:note[parent::text]][$streamID = 'CA01' or $streamID = 'CA02CC' or $streamID = 'CA04']">
      <xsl:apply-templates/>
    </xsl:template>
    Template p/@indent
    Namespace No namespace
    Match p/@indent
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p/@indent">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template p[parent::text][$streamID = 'UK12']
    Namespace No namespace
    Match p[parent::text][$streamID = 'UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="p[parent::text][$streamID = 'UK12']">
      <xsl:apply-templates select="@* | node()"/>
    </xsl:template>
    Template following_p_level
    Documentation

    Description

     Awantika: Added template to handle p/inlineobject in HK07 to p/text/ref:inlineobject
        JL: this isn't going to account for all scenarios; moved functionality to inlineobject templates
     from text dita: <note><b>(For CANADA Content Stream only )</b>Only move the <sourcexml>
            text@align</sourcexml> to the parent <targetxml>p</targetxml> if it is the only
            text in <sourcexml>p</sourcexml>, Otherwise, wrap the <sourcexml>text</sourcexml>
            with <targetxml>p</targetxml> and move the <sourcexml>@align</sourcexml> attribute
            to the newly created <targetxml> p</targetxml>.</note>
        <section>
            <codeblock> &lt;p&gt; &lt;text&gt;Dated at Calgary, Alberta this 31 day of March
                1998.&lt;/text&gt; &lt;text&gt;The Honourable W. Kenneth Moore, Chief Justice of
                the Court of Queen's Bench of Alberta&lt;/text&gt; &lt;text
                align="center"&gt;ALBERTA RULES&lt;/text&gt; &lt;text&gt;Rules of practice made
                pursuant to subsection 745.64 of the Criminal Code to reflect the changes made
                to the Criminal Code regarding applications for reduction in the number of years
                of imprisonment without eligibility for parole.&lt;/text&gt; &lt;/p&gt; </codeblock>
            <b>Becomes</b>
            <codeblock> &lt;p&gt; &lt;text&gt;Dated at Calgary, Alberta this 31 day of March
                1998.&lt;/text&gt; &lt;text&gt;The Honourable W. Kenneth Moore, Chief Justice of
                the Court of Queen's Bench of Alberta&lt;/text&gt; &lt;/p&gt; &lt;p
                align="center"&gt; &lt;text&gt;ALBERTA RULES&lt;/text&gt; &lt;/p&gt; &lt;p&gt;
                &lt;text&gt;Rules of practice made pursuant to subsection 745.64 of the Criminal
                Code to reflect the changes made to the Criminal Code regarding applications for
                reduction in the number of years of imprisonment without eligibility for
                parole.&lt;/text&gt; &lt;/p&gt; </codeblock>
        </section>
     JL: seems like the @nl handling  will not behave properly unless we move it to the text template.  
            I moved it to XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_text-LxAdv-text-with-test-for-whitespace-content.xsl
            PLEASE LOOK THERE!!!!!! IF YOU NEED TO ADD IT TO ANOTHER MODULE FOR ELEMENT <text> 
     BRT: included this specific text match template because it's part of p[@nl]. Added this template 
        <xsl:template match="p[@nl != '']/text">
            <xsl:element name="text">
                <xsl:apply-templates select="@*"/>           
                <!-\- BRT add number of nl that are in p/@nl -\->
                <xsl:call-template name="add_nl">
                    <xsl:with-param name="length" select="parent::p/@nl"/>
                    <xsl:with-param name="i" select="1"/>
                </xsl:call-template>
    
                <!-\- BRT remove hard-coded nl that are in source -\->
                <xsl:apply-templates select="*[not(self::nl)] | text()"/>
            </xsl:element>
        </xsl:template>
    
    
    
        <xsl:template name="add_nl">
            <xsl:param name="length" select="."/>
            <xsl:param name="i" select="1"/>
            <!-\- BRT: create <nl/> for each iteration of @nl value -\->
            <xsl:if test="$length &gt; 0">
                <xsl:element name="proc:nl"/>
                <xsl:call-template name="add_nl">
                    <xsl:with-param name="length" select="$length - 1"/>
                    <xsl:with-param name="i" select="$i + 1"/>
                </xsl:call-template>
            </xsl:if>
        </xsl:template>
    Namespace No namespace
    Used by
    Template
    Import precedence 0
    Source
    <xsl:template name="following_p_level">
      <xsl:choose>
        <xsl:when test="child::heading/title/refpt">
          <seclaw:level>
            <xsl:attribute name="leveltype">
              <xsl:value-of select="@leveltype"/>
            </xsl:attribute>
            <xsl:apply-templates select="child::heading/title/refpt"/>
            <xsl:apply-templates select="@* | node() except (level[preceding-sibling::bodytext])"/>
          </seclaw:level>
        </xsl:when>
      </xsl:choose>
    </xsl:template>
    Template p[text[not(node()) or (string() and not(normalize-space()) and not(*))] and count(*)=1 ]
    Documentation

    Description

     JD: 2017-07-21: added trap for p containing only empty node or single whitespace to match DT output.
    	e.g., 
    	<p>
    	  <text/>
    	</p>
    	
    Namespace No namespace
    Match p[text[not(node()) or (string() and not(normalize-space()) and not(*))] and count(*)=1 ]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p[text[not(node()) or (string() and not(normalize-space()) and not(*))] and count(*)=1 ]"/>
    Template p[* and not(*[not(self::text[* and not(text()) and not(*[not(self::nl)])])])]
    Documentation

    Description

     
    		JD:		match p that has at least one element child, and don't have any children not named 'text', which doesn't have any text() or children not named 'br' 
    		e.g.,
     		 <p>
    				<text>
    					<nl/>
    					<nl/>
    				</text>
    			</p>
    		taken from https://stackoverflow.com/questions/11438787/find-an-element-that-only-has-one-other-kind-of-child
    	
    Namespace No namespace
    Match p[* and not(*[not(self::text[* and not(text()) and not(*[not(self::nl)])])])]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p[* and not(*[not(self::text[* and not(text()) and not(*[not(self::nl)])])])]"/>
    Template p[not(node())][$streamID = 'AU13']
    Documentation

    Description

     MDS 2017-08-11 - Added supression of completely empty paragraph elements.  Only for specific streams 
    Namespace No namespace
    Match p[not(node())][$streamID = 'AU13']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="p[not(node())][$streamID = 'AU13']"/>
    Template p[(parent::blockquote|parent::bodytext)[not(ancestor::fnbody)][ancestor::form[ancestor::COMMENTARYDOC]]]
    Documentation

    Description

    If p comes within /COMMENTARYDOC/comm:body/level/level/bodytext/form/bodytext/p then p becomes form:p. And if @indent occurred into the p then @indent becomes @indent and populated as follows:

    Source XML

                        
                        <form>
                        <bodytext searchtype="FORM">
                        <p><text><emph typestyle="bf">THIS AGREEMENT</emph> is made on&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 2010</text></p>
                        .......
                        .......
                        <h align="center">1.&#160;&#160;&#160;&#160;&#160;&#160;&#160; The Independent Expert has been appointed by the parties under clause .. of the Agreement to assist in resolving the dispute or to resolve the dispute by determining the meaning of clause &hellip;&#160; of
                        the Agreement and also to determine which party or parties should pay the costs of and incidental to the resolution of the dispute.</h>
                        <h align="center">2.&#160;&#160;&#160;&#160;&#160;&#160;&#160; The Independent Expert has accepted the appointment, and will assist in determining or will determine the dispute in accordance with the terms of this agreement.</h>
                        ........
                        ........
                        <h align="center">&#160;</h>
                        </bodytext>
                        </form>
                        
                    
    Becomes
                        
                        <form:form>
                        <form:document annotated="false" official="false" typeofdoc="unnamed">
                        <form:bodytext>
                        <form:p>
                        <form:text><emph typestyle="bf">THIS AGREEMENT</emph> is made on&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0; 2010</form:text></form:p>
                        ......
                        ......
                        <form:h align="center">1.&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;The Independent Expert has been appointed by the parties under clause .. of the Agreement to assist in resolving the
                        dispute or to resolve the dispute by determining the meaning of clause &#x2026;&#x00A0;� of the Agreement and also to determine which party or parties should pay the costs of and
                        incidental to the resolution of the dispute.</form:h>
                        <form:h align="center">2.&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;The Independent Expert has accepted the appointment, and will assist in determining or will determine the dispute in accordance with the terms of this agreement.</form:h>
                        ......
                        ......
                        <form:h align="center">&#x00A0;</form:h>
                        </form:bodytext>
                        </form:document>
                        </form:form>
                        
                    

    Description

     <topicref href="../../common_newest/Rosetta_form_bodytext_p-LxAdv-form.p.dita"/> 
    Namespace No namespace
    Match p[(parent::blockquote|parent::bodytext)[not(ancestor::fnbody)][ancestor::form[ancestor::COMMENTARYDOC]]]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p[(parent::blockquote|parent::bodytext)[not(ancestor::fnbody)][ancestor::form[ancestor::COMMENTARYDOC]]]">
      <!--  Original Target XPath:  form:p   -->
      <form:p>
        <xsl:apply-templates select="@* | node()"/>
      </form:p>
    </xsl:template>
    Template p[$streamID=('UK14', 'UK12')][(parent::blockquote)[ancestor::form[ancestor::COMMENTARYDOC]]]
    Namespace No namespace
    Match p[$streamID=('UK14', 'UK12')][(parent::blockquote)[ancestor::form[ancestor::COMMENTARYDOC]]]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="p[$streamID=('UK14', 'UK12')][(parent::blockquote)[ancestor::form[ancestor::COMMENTARYDOC]]]" priority="2">
      <!-- WPK: form:p is not schema valid within blockquote -->
      <p>
        <xsl:apply-templates select="@* | node()"/>
      </p>
    </xsl:template>
    Template @indent
    Namespace No namespace
    Match @indent
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="@indent">
      <!--  Original Target XPath:  @indent   -->
      <xsl:attribute name="indent">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template p[child::glp:note]
    Documentation

    Description

    If glp:note comes within p then note would become part of bodytext as a sibling to p

                        <li><lilabel>(b)</lilabel>
                        <p><text>a copy of the certificate.</text></p><!-- branch 2 -->
                        <p>
                        <glp:note>
                        <p><text><emph typestyle="it"><emph typestyle="it">Note 1</emph> If a form is approved under s&#160;15 for this provision, the form must be used.</emph></text></p>
                        </glp:note></p>
                    
    Becomes
                       <listitem>
                       <label>(b)</label>
                       <bodytext>
                       <p><text>a copy of the certificate.</text></p>
                       <note>
                       <bodytext>
                       <p><text><emph typestyle="it"><emph typestyle="it">Note 1</emph> If a form is approved under s&#160;15 for this provision, the form must be used.</emph></text></p>
                       </bodytext>
                       </note>
                       </bodytext>
                        
                     

    Added from Rosetta_defitem-LxAdv-deflist_defitem_desfdesc_bodytext.xsl

    If the source XML has deflist/defitem/glp:note it will be handled as deflist/defitem/defdesc/bodytext/note.

    Source XML

                 
                 <deflist>
                 <defitem>
                 ...
                 <glp:note>
                 <p>
                 <text>
                 <emph typestyle="it">Note: The definition of
                 &ldquo;community corrections officer&rdquo; is
                 affected by section&#160;10.</emph>
                 </text>
                 </p>
                 </glp:note>
                 </defitem>
                 </deflist>
                 
             

    Target XML

                 
                 <deflist>
                 <defitem>
                 ...
                 <defdesc>
                 <bodytext>
                 <note>
                 <bodytext>
                 <p>
                 <text>
                 <emph typestyle="it">Note: The definition of
                 &ldquo;community corrections officer&rdquo; is
                 affected by section&#160;10.</emph>
                 </text>
                 </p>
                 </bodytext>
                 </note>
                 </bodytext>
                 </defdesc>
                 </defitem>
                 </deflist>
                 
             

    Description

     <topicref href="../../common_newest/Rosetta_p_glp.note-LxAdv-bodytext_note.dita"/> 
     BRT: the following template is in base.xsl, match="p" in xsl:when test="child::glp:note" choice. I did not split this out in base.xsl - left 'as is' in when 
    Namespace No namespace
    Match p[child::glp:note]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p[child::glp:note]">
      <!-- don't create p in LA if the child of p is glp:note. This won't work if there is more than glp:note that is a child of p -->
      <xsl:apply-templates/>
    </xsl:template>
    Template p/glp:note
    Documentation

    Description

     BRT: the following template is taken from base.xsl, match="glp:note" in otherwise choice. I did not split this out in base.xsl - left 'as is' in otherwise choice
    Namespace No namespace
    Match p/glp:note
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p/glp:note">
      <xsl:element name="note">
        <xsl:apply-templates select="@*"/>
        <xsl:apply-templates select="heading"/>
        <xsl:element name="bodytext">
          <!-- BRT: added choice group -->
          <xsl:choose>
            <!-- may be other elements that need to be added to this choice -->
            <xsl:when test="remotelink">
              <xsl:element name="p">
                <xsl:element name="text">
                  <xsl:apply-templates select="*[not(self::heading or self::refpt)]"/>
                </xsl:element>
              </xsl:element>
            </xsl:when>
            <xsl:otherwise>
              <xsl:apply-templates select="*[not(self::heading or self::refpt)]"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template p-limited
    Documentation

    Description

    p-limited becomes p. Also create a child element text within p for capturing the PCDATA of p-limited.

    Source XML

    
    <entry align="center">
        <p-limited>
            <emph typestyle="bu">AGENDA</emph>
        </p-limited>
    </entry>
    			

    Target XML

    
    <entry align="center">
        <p>
            <text>
                <emph typestyle="bu">AGENDA</emph>
            </text>
        </p>
    </entry>
    				

    Description

     end topichead  p  
     start topichead  p-limited  
     <topicref href="../../common_newest/Rosetta_p-limited-LxAdv-p.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_p-limited-LxAdv-p.dita  
     BRT: this is the same rule as in Rosetta_p-limited_emph-LxAdv-p_text_emph.dita, and is already addressed there. 
                     The otherwise condition in match="p-limited" creates p (no text), which conflicts with this rule. 
    Satbir: Define low priority in below template for p-limited because same template created in another xsl (Rosetta_entry_p-limited-LxAdv-entry_p.xsl)
    Namespace No namespace
    Match p-limited
    Mode #default
    Import precedence 0
    Priority 10
    Source
    <xsl:template match="p-limited" priority="10">
      <p>
        <text>
          <xsl:apply-templates select="@* | node()"/>
        </text>
      </p>
    </xsl:template>
    Template p-limited[child::emph]
    Documentation

    Description

    When emph occurs as a direct child of p-limited then p-limited/emph becomes p/text/emph.

    Source XML

    
    <entry>
        <p-limited>
            <emph typestyle="caps">Box</emph>
        </p-limited>
    </entry>
    
    	

    Target XML

    
    <entry>
        <p>
            <text>
                <emph typestyle="caps">Box</emph>
            </text>
        </p>
    </entry>
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_p-limited_emph-LxAdv-p_text_emph.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_p-limited_emph-LxAdv-p_text_emph.dita  
     BRT: this template is in one condition of match="p-limited" in base.xsl
                 
    Namespace No namespace
    Match p-limited[child::emph]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p-limited[child::emph]">
      <xsl:element name="p">
        <xsl:element name="text">
          <xsl:apply-templates/>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template entry/p-limited[child::glp:note]
    Documentation

    Description

    When glp:note occurs as a direct child of entry/p-limited then entry/p-limited/glp:note becomes entry/note. The entry/note will occur as a sibling to any p elements within the entry. If there is any text (PC-DATA) that is part of the entry but occurs immediately before the p-limited, an empty p element should be created immediately before the note as a sibling to the note.

    Source XML

    
    <entry colname="c2" colsep="0" rowsep="0">deal... 
        <p-limited>
            <glp:note>
                <blockquote>
                    <p indent="none">
                        <text>In relation to the...</text>
                    </p>
                </blockquote>
            </glp:note>
        </p-limited>
    </entry>
    
    	

    Target XML

    
    <entry colname="c2" colsep="0" rowsep="0">deal... 
        <p/>
        <note>
            <bodytext>
                <blockquote>
                    <p indent="none">
                        <text>In relation to the...</text>
                    </p>
                </blockquote>
            </bodytext>
        </note>
    </entry>
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_p-limited_glp.note-LxAdv-entry_note.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_p-limited_glp.note-LxAdv-entry_note.dita  
     BRT: Added this template as a condition to match="p-limited" in base.xsl.
                 
    Namespace No namespace
    Match entry/p-limited[child::glp:note]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="entry/p-limited[child::glp:note]">
      <xsl:element name="p"/>
      <xsl:apply-templates/>
    </xsl:template>
    Template p-limited
    Documentation

    Description

    entry/p-limited becomes entry/p. Also create a child element text within entry/p for capturing the PCDATA of entry/p-limited.

    If multiple consecutive p-limited elements occur within entry then create only one p within entry and multiple child text elements with the single p. Create one p/text element for each p-limited element.

    Source XML

                        
                        <entry>
                        <p-limited>Pleaded guilty to one charge of cultivating cannabis, one charge of possession for supply and one charge of supply.</p-limited> 
                        <p-limited>The appellant was the owner of a horticultural property. No criminal history. Four rows of cannabis plants growing in an extension to a hothouse. Maturing plants, stalks from harvested plants, and traces of drying cannabis leaf found. A total of 303 cannabis plants grown in a hydroponic solution.</p-limited> 
                        </entry>
                        
                    

    Target XML

                        
                        <entry>
                        <p>
                        <text>Pleaded guilty to one charge of cultivating cannabis, one charge of possession for supply and one charge of supply.</text>
                        <text>The appellant was the owner of a horticultural property. No criminal history. Four rows of cannabis plants growing in an extension to a hothouse. Maturing plants, stalks from harvested plants, and traces of drying cannabis leaf found. A total of 303 cannabis plants grown in a hydroponic solution.</text> 
                        </p>
                        </entry>
                        
                    

    Note: If l is a child of entry/p-limited then entry/p-limited/l becomes entry/p/list. For further clarification please see the following example.

    Source XML

                        <entry colname="col2">
                        <p-limited>Act is partly in force:
                        <l>
                        <li>
                        <p>
                        <text>ss. 61 (a) as it repeals the definition of ...</text>
                        </p>
                        </li>
                        </l>
                        </p-limited>
                        </entry>
                    

    Target XML

                        <entry colname="col2">
                        <p>
                        <text>Act is partly in force:</text>
                        <list>
                        <listitem>
                        <bodytext>
                        <p>
                        <text>ss. 61 (a) as it repeals the definition of ...</text>
                        </p>
                        </bodytext>
                        </listitem>
                        </list>
                        </p>
                        </entry>
                    

    Description

     <topicref href="../../common_newest/Rosetta_entry_p-limited-LxAdv-entry_p.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_entry_p-limited-LxAdv-entry_p.dita  
    <xsl:message>Rosetta_entry_p-limited-LxAdv-entry_p.xsl requires manual development!</xsl:message> 
    Satbir: Define the high priority in below template for p-limited because same template created in another xsl (Rosetta_p-limited-LxAdv-p.xsl)
    Namespace No namespace
    Match p-limited
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 15
    Source
    <xsl:template match="p-limited" priority="15">
      <xsl:variable name="docinfoidtext" select="/CITATORDOC/docinfo/source_docinfo:doc-id/text()"/>
      <xsl:choose>
        <xsl:when test="parent::table and preceding-sibling::tgroup">
          <xsl:element name="note">
            <xsl:element name="bodytext">
              <xsl:element name="p">
                <xsl:element name="text">
                  <xsl:apply-templates/>
                </xsl:element>
              </xsl:element>
            </xsl:element>
          </xsl:element>
        </xsl:when>
        <xsl:when test="child::emph">
          <xsl:element name="p">
            <xsl:element name="text">
              <!-- Awantika:2017-11-24- Webstar # 7048152. If glp:note is coming in p-limited with emph then in target we need to take out glp:note target markup note
                                from p/text as schema does not allow note inside p/text.
                                entry/p-limited/glp:note to entry/note -->
              <xsl:apply-templates select="node() except glp:note"/>
            </xsl:element>
          </xsl:element>
          <xsl:apply-templates select="glp:note"/>
        </xsl:when>
        <!-- BRT: added the following case, result is entry/note -->
        <xsl:when test="parent::entry and child::glp:note">
          <xsl:apply-templates/>
        </xsl:when>
        <!-- generalizing this condition -->
        <!-- AS: As per the instructions for p-limited "p-limited becomes p. Also create a child element text within p for capturing the PCDATA of p-limited." -->
        <xsl:when test="parent::entry">
          <!-- Awantika: For AU20 entry/p-limited becomes textitem  -->
          <xsl:choose>
            <xsl:when test="contains(lower-case($docinfoidtext),'history') and parent::entry and $streamID='AU20'">
              <textitem>
                <xsl:apply-templates/>
              </textitem>
            </xsl:when>
            <xsl:otherwise>
              <xsl:element name="p">
                <xsl:element name="text">
                  <xsl:apply-templates/>
                </xsl:element>
              </xsl:element>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:when>
        <!-- BRT: added the following -->
        <xsl:when test="child::remotelink">
          <xsl:element name="p">
            <xsl:element name="text">
              <xsl:apply-templates/>
            </xsl:element>
          </xsl:element>
        </xsl:when>
        <xsl:when test="child::ci:cite">
          <xsl:element name="p">
            <xsl:element name="text">
              <xsl:apply-templates/>
            </xsl:element>
          </xsl:element>
        </xsl:when>
        <xsl:otherwise>
          <xsl:element name="p">
            <xsl:apply-templates/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template p-limited[child::ci:cite]
    Documentation

    Description

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    When remotelink occurs as a direct child of p-limited then p-limited/remotelink becomes p/text/lnlink.

    Source XML

    
    <entry colname="col3" colsep="0" rowsep="0" align="right" valign="top">
        <!-- ETC. -->
        <p-limited>
            <remotelink href="www.kpmg.com.au/default.aspx?tabid=145" hrefclass="http" newwindow="YES">
                <inlineobject type="image" attachment="ln-server" filename="kpmglogo.gif" />
            </remotelink>
        </p-limited>
    </entry>
    
    			

    Target XML

    
    <entry colname="col3" colsep="0" rowsep="0" align="right" valign="top">
        <!-- ETC. -->
        <p><text>
            <ref:lnlink service="URL">
                <ref:marker>
                    <ref:inlineobject>
                        <ref:locator>
                            <ref:locator-key>
                                <ref:key-name name="object-key"/>
                                <ref:key-value value="X-Y-kpmglogo"/>  <!-- X and Y are LNI and SMI values obtained from CSSM -->
                            </ref:locator-key>
                            <ref:locator-params>
                                <proc:param name="componentseq" value="1"/>
                                <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                                <proc:param name="object-smi" value=""/>  <!-- This @value assignment is done by conversion program -->
                            </ref:locator-params>
                        </ref:locator>
                    </ref:inlineobject>
                </ref:marker>
                <ref:locator>
                    <ref:locator-key>
                        <ref:key-name name="URL"/>
                        <ref:key-value value="http://www.kpmg.com.au/default.aspx?
                                tabid=145"/>
                    </ref:locator-key>
                </ref:locator>
            </ref:lnlink>
        </text></p>
    </entry>
    
    			

    Description

    When ci:cite occurs as a direct child of p-limited then p-limited/ci:cite becomes p/text/lnci:cite.

    Source XML

    
    <entry>
        <p-limited>Diagram drawn at August 16, 2001 hearing by Mr. Yakimishyn. Location plan NW 4 <ci:cite><ci:case><ci:caseref ID="cref00000588" spanref="cspan00000588"><ci:reporter country="US" value="N.E." normpubcode="627"/><ci:volume num="8"/><ci:page num="5"/></ci:caseref></ci:case><ci:content><ci:span spanid="cspan00000588">8 NE 5</ci:span></ci:content></ci:cite>-56-17-4. Submitted by Mr. Yakimishyn.</p-limited>
    </entry>
    
    	

    Target XML

    
    <entry>
        <p><text>Diagram drawn at August 16, 2001 hearing by Mr. Yakimishyn. Location plan NW 4 <lnci:cite><lnci:case><lnci:caseref ID="cref00000588"><lnci:reporter country="US" value="N.E." normpubcode="627"/><lnci:volume num="8"/><lnci:page num="5"/></lnci:caseref></lnci:case><lnci:content>8 NE 5</lnci:content></lnci:cite>-56-17-4. Submitted by Mr. Yakimishyn.</text></p>
    </entry>
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_p-limited_remotelink-LxAdv-p_text_ref.lnlink.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_p-limited_remotelink-LxAdv-p_text_ref.lnlink.dita  
        The XSLT for this module is covered in Rosetta_remotelink-LxAdv-ref.crossreference.xsl  
     <topicref href="../../common_newest/Rosetta_p-limited_ci.cite-LxAdv-p_text_lnci.cite.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_p-limited_ci.cite-LxAdv-p_text_lnci.cite.dita  
     BRT: this template is in one condition of match="p-limited" in base.xsl
                 
    Namespace No namespace
    Match p-limited[child::ci:cite]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="p-limited[child::ci:cite]">
      <xsl:element name="p">
        <xsl:element name="text">
          <xsl:apply-templates/>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template page[not(ancestor::entry) and not(parent::catchwordgrp or parent::catchwords)]page-generic
    Documentation

    Description

    Instructions [common element]

    page becomes ref:page and also create doc:docinfo/doc:pagination/doc:pagination-scheme and attributes are mapped as follows:

    • page/@count becomes ref:page/@num
    • page/@reporter becomes ref:page/@page-scheme and doc:pagination-scheme/@page-scheme
    • ref:page/@page-scheme-type and doc:pagination-scheme/@page-scheme-type should be set to "reporter-abbreviation"
    • page/@text should be dropped.
    • page/@subdoc becomes ref:page/@includeintoc.

    Note: Do not create multiple identical doc:pagination-scheme. Source may have multiple page with identical @reporter value. Create only one doc:pagination-scheme for each unique @reporter value.

    Note: According to the LBU, the presentation spec expects the page references to generate the displayable reporter part from the citation. The @text is dropped because the stylesheet is expected to generate the displayable portion of the page break.

    Source XML

    
    <page count="3" reporter="alr" subdoc="true" text="256 ALR 1 at "/>
    ...
    <page count="4" reporter="alr" subdoc="true" text="256 ALR 1 at "/>
    
    	

    Target XML

    
    <ref:page num="3" page-scheme="alr" page-scheme-type="reporter-abbreviation" includeintoc="true"/>
    ...
    <ref:page num="4" page-scheme="alr" page-scheme-type="reporter-abbreviation" includeintoc="true"/>
    
    and
    
    <doc:docinfo>
        <doc:pagination>
            <doc:pagination-scheme page-scheme="alr" page-scheme-type="reporter-abbreviation"/>
        </doc:pagination>
    </doc:docinfo>
    	

    If comma ( , ) or periods ( . ) occurs in attribute value of count i.e, page/@count then comma or period should be stripped out (removed) from target attribute value i.e, ref:page/@num.

    Source XML

    <page reporter="bpr" count="23,043" text="12 BPR 23,041 at " subdoc="true" />
    		

    Target XML

    <ref:page num="23043" page-scheme="bpr" page-scheme-type="reporter-abbreviation" includeintoc="true"/>
    
    and 
    
    <doc:docinfo>
        <doc:pagination>
            <doc:pagination-scheme page-scheme="bpr" page-scheme-type="reporter-abbreviation"/>
        </doc:pagination>
    </doc:docinfo>
    	

    Source XML

    <page text="(2009) 1(2) JML 159–172 at" count="16…4" reporter="JML" />
    		

    Target XML

    <ref:page num="164" page-scheme="JML" page-scheme-type="reporter-abbreviation"/>
    
    and 
    
    <doc:docinfo>
        <doc:pagination>
            <doc:pagination-scheme page-scheme="JML" page-scheme-type="reporter-abbreviation"/>
        </doc:pagination>
    </doc:docinfo>
    	

    If space occurs in attribute value of reporter i.e, page/@reporter then underscore( _ ) should be used at the place of space in target attribute value i.e, ref:page/@page-scheme and doc:pagination-scheme/@page-scheme.

    Source XML

    <page reporter="Fam LR" count="1033" text="10 Fam LR 1032 at " subdoc="true"/>
    		

    Target XML

    <ref:page num="1033" page-scheme="Fam_LR" page-scheme-type="reporter-abbreviation" includeintoc="true"/>
    	
    and 
    	
    <doc:docinfo>
        <doc:pagination>
            <doc:pagination-scheme page-scheme="Fam_LR" page-scheme-type="reporter-abbreviation"/>
        </doc:pagination>
    </doc:docinfo>
    	

    If page is a child of li, then the ref:page should be placed at the beginning of the following label in the target.

    Source XML

    <l>
        <li>
            <lilabel>(a)</lilabel>
            <p>
                <text>if subparagraph (1)(b)(i) applies &#x2013; under the provision of the new corporations legislation that corresponds to the relevant
                    old provision; or</text>
            </p>
        </li>
        <li>
            <page reporter="Qd R" count="147" text="[2004] 1 Qd R 146 at " subdoc="true"/>
            <lilabel>(b)</lilabel>
            <p>
                <text>if subparagraph (1)(b)(ii) applies &#x2013; as, or connected with, a prosecution for an offence against the provision of the new
                    corporations legislation that corresponds to the relevant old provision.</text>
            </p>
        </li>
    </l>
    	

    Target XML

    <list>
        <listitem>
            <label>(a)</label>
            <bodytext>
                <p>
                    <text>if subparagraph (1)(b)(i) applies &#x2013; under the provision of the new corporations legislation that corresponds to the
                        relevant old provision; or</text>
                </p>
            </bodytext>
        </listitem>
        <listitem>
            <label><ref:page page-scheme-type="reporter-abbreviation" page-scheme="Qd_R" num="147" includeintoc="true"/>(b)</label>
            <bodytext>
                <p>
                    <text>if subparagraph (1)(b)(ii) applies &#x2013; as, or connected with, a prosecution for an offence against the provision of the new
                        corporations legislation that corresponds to the relevant old provision.</text>
                </p>
            </bodytext>
        </listitem>
    </list>
    
    and
    
    <doc:docinfo>
        <doc:pagination>
            <doc:pagination-scheme page-scheme="Qd_R" page-scheme-type="reporter-abbreviation"/>
        </doc:pagination>
    </doc:docinfo>
    	

    Description

     end topichead  p-limited  
     start topichead  page  
     <topicref href="../../common_newest/Rosetta_page-LxAdv-ref.page.dita"/> 
    Namespace No namespace
    Match page[not(ancestor::entry) and not(parent::catchwordgrp or parent::catchwords)]
    Mode #default
    Used by
    Import precedence 0
    Source
    <xsl:template match="page[not(ancestor::entry) and not(parent::catchwordgrp or parent::catchwords)]" name="page-generic">
      <xsl:if test="@count!='' and matches(translate(@count,',.…',''),'^\d+$')">
        <!-- don't process if there is no value converted to @num (invalid), or if source @count is not a digit -->
        <xsl:element name="ref:page">
          <xsl:attribute name="num">
            <xsl:value-of select="translate(@count,',.…','')"/>
          </xsl:attribute>
          <xsl:if test="@reporter!=''">
            <xsl:attribute name="page-scheme">
              <xsl:value-of select="translate(@reporter,' ','_')"/>
            </xsl:attribute>
          </xsl:if>
          <xsl:if test="@subdoc!=''">
            <xsl:attribute name="includeintoc">
              <xsl:value-of select="@subdoc"/>
            </xsl:attribute>
          </xsl:if>
          <xsl:attribute name="page-scheme-type">
            <xsl:text>reporter-abbreviation</xsl:text>
          </xsl:attribute>
        </xsl:element>
      </xsl:if>
    </xsl:template>
    Template page[$streamID='HK03'][parent::case:headnote | parent::case:info | parent::catchwords]
    Namespace No namespace
    Match page[$streamID='HK03'][parent::case:headnote | parent::case:info | parent::catchwords]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 1
    Source
    <xsl:template match="page[$streamID='HK03'][parent::case:headnote | parent::case:info | parent::catchwords]" priority="1">
      <!--[parent::case:info and $streamID='HK03'][not(parent::catchwords and $streamID='HK03')]-->
      <xsl:if test="parent::case:info">
        <classify:classification>
          <classify:classitem>
            <classify:classitem-identifier>
              <classify:classname>
                <xsl:element name="ref:page">
                  <xsl:attribute name="num">
                    <xsl:value-of select="translate(@count,',.…','')"/>
                  </xsl:attribute>
                  <xsl:if test="@reporter!=''">
                    <xsl:attribute name="page-scheme">
                      <xsl:value-of select="translate(@reporter,' ','_')"/>
                    </xsl:attribute>
                  </xsl:if>
                  <xsl:if test="@subdoc!=''">
                    <xsl:attribute name="includeintoc">
                      <xsl:value-of select="@subdoc"/>
                    </xsl:attribute>
                  </xsl:if>
                  <xsl:attribute name="page-scheme-type">
                    <xsl:text>reporter-abbreviation</xsl:text>
                  </xsl:attribute>
                </xsl:element>
              </classify:classname>
            </classify:classitem-identifier>
          </classify:classitem>
        </classify:classification>
      </xsl:if>
      <xsl:if test="parent::catchwords">
        <classify:classitem>
          <classify:classitem-identifier>
            <classify:classname>
              <xsl:element name="ref:page">
                <xsl:attribute name="num">
                  <xsl:value-of select="translate(@count,',.…','')"/>
                </xsl:attribute>
                <xsl:if test="@reporter!=''">
                  <xsl:attribute name="page-scheme">
                    <xsl:value-of select="translate(@reporter,' ','_')"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:if test="@subdoc!=''">
                  <xsl:attribute name="includeintoc">
                    <xsl:value-of select="@subdoc"/>
                  </xsl:attribute>
                </xsl:if>
                <xsl:attribute name="page-scheme-type">
                  <xsl:text>reporter-abbreviation</xsl:text>
                </xsl:attribute>
              </xsl:element>
            </classify:classname>
          </classify:classitem-identifier>
        </classify:classitem>
      </xsl:if>
      <xsl:if test="parent::case:headnote">
        <xsl:element name="ref:page">
          <xsl:attribute name="num">
            <xsl:value-of select="translate(@count,',.…','')"/>
          </xsl:attribute>
          <xsl:if test="@reporter!=''">
            <xsl:attribute name="page-scheme">
              <xsl:value-of select="translate(@reporter,' ','_')"/>
            </xsl:attribute>
          </xsl:if>
          <xsl:if test="@subdoc!=''">
            <xsl:attribute name="includeintoc">
              <xsl:value-of select="@subdoc"/>
            </xsl:attribute>
          </xsl:if>
          <xsl:attribute name="page-scheme-type">
            <xsl:text>reporter-abbreviation</xsl:text>
          </xsl:attribute>
        </xsl:element>
      </xsl:if>
    </xsl:template>
    Template page[ancestor::entry]
    Documentation

    Description

    Satbir: Generate this template for handling the 'exception timestamp' error while during the transforming of input files
    Namespace No namespace
    Match page[ancestor::entry]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="page[ancestor::entry]"/>
    Template page[parent::bodytext[parent::level]][$streamID=('AU05' , 'NZ09')]
    Documentation

    Description

     20171017 JL: for when page is a child of seclaw:bodytext 
    Namespace No namespace
    Match page[parent::bodytext[parent::level]][$streamID=('AU05' , 'NZ09')]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="page[parent::bodytext[parent::level]][$streamID=('AU05' , 'NZ09')]" priority="2">
      <textitem>
        <xsl:call-template name="page-generic"/>
      </textitem>
    </xsl:template>
    Template page[parent::case:info][$streamID=('UK01')]
    Documentation

    Description

     Webstar 7043871 - CSN - 20171108 - adding page wrapper for schema validity. CI does not address this so matching DT. 
    Namespace No namespace
    Match page[parent::case:info][$streamID=('UK01')]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="page[parent::case:info][$streamID=('UK01')]" priority="2">
      <note notetype="other">
        <bodytext>
          <xsl:call-template name="page-generic"/>
        </bodytext>
      </note>
    </xsl:template>
    Template person
    Documentation

    Description

    Instructions [common element]

    person becomes person:person.

    • role becomes role.
      • fnr[@fntoken] becomes footnote/ref:anchor[@id]
    • name.text becomes person:name.text
    • name.detail becomes person:name.detail
      • name.degree becomes person:name.degree
      • name.honorific becomes person:name.honorific

    Note: If remotelink[@hrefclass="http"][@href] or url/remotelink[@hrefclass="http"] is present, convert according to the instructions for url/remotelink, only creating a parent url if it is present.

    Source XML

     <p> <text> <person> <name.text>Norman
                        Lyall</name.text> <name.detail> <name.degree>BA,
                        LLB,</name.degree> </name.detail> <role>Solicitor of the
                        Supreme Court of New South Wales</role> </person> </text>
                        </p> 

    Target XML

     <p> <text> <person:person>
                        <person:name.text>Norman Lyall</person:name.text>
                        <person:name.detail> <person:name.degree>BA,
                        LLB,</person:name.degree> </person:name.detail>
                        <role>Solicitor of the Supreme Court of New South Wales</role>
                        </person:person> </text></p> 

    Source XML: role/fnr

     <p> <text> <person> <role>by</role>
                        <name.text>A J ABADEE</name.text> <role>Barrister-at-law,
                        Sydney <fnr fntoken="ACLP.C3.SC4.FNT1"
                        fnrtoken="ACLP.C3.SC4.FNT1-R">*</fnr> </role> </person>
                        </text></p> 

    Target XML: role/fnr

     <p> <text> <person:person> <role>by</role>
                        <person:name.text>A J ABADEE</person:name.text>
                        <role>Barrister-at-law, Sydney <footnote> <ref:anchor
                        id="ACLP.C3.SC4.FNT1"/> <label>&#x002A;</label>
                        <bodytext> <p><text>Based on original commentary
                        by</text></p> <p><text>J F
                        CORKERY</text></p> <p><text>Professor of Law, Bond
                        University</text></p> </bodytext> </footnote>
                        </role> </person:person> </text> </p> 

    Source XML

     <p> <text> <role>Chairman, Australian Advocacy
                        Institute</role> </text> </p> 

    Target XML

     <p> <text> <person:person> <role>Chairman,
                        Australian Advocacy Institute</role> </person:person> </text>
                        </p> 

    Source person/name.detail/name.honorific

     <person> <name.text>The Hon R O Blanch</name.text>
                        <name.detail> <name.honorific>AM</name.honorific>
                        </name.detail> ... </person> 

    Target person:person/person:name.detail/person:name.honorific

     <person:person> <person:name.text>The Hon R O
                        Blanch</person:name.text> <person:name.detail>
                        <person:name.honorific>AM</person:name.honorific>
                        </person:name.detail> ... </person:person> 

    Description

     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_page_with_preceding-following-siblings_case.decisionsummary.dita"/> 
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_page_with_preceding-following-siblings_case.decisionsummary.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     end topichead  page  
     start topichead  person  
     <topicref href="../../common_newest/Rosetta_person-LxAdv-person.person.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_person-LxAdv-person.person.dita  
    Namespace No namespace
    Match person
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="person">
      <xsl:choose>
        <xsl:when test="parent::contrib and $streamID = 'UK09'">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:element name="person:person">
            <xsl:apply-templates select="@* | node()"/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template bio[not(child::addl-info)][$streamID='UK12']
    Namespace No namespace
    Match bio[not(child::addl-info)][$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="bio[not(child::addl-info)][$streamID='UK12']" priority="25">
      <xsl:choose>
        <xsl:when test="parent::person">
          <person:bio>
            <person:bio.text>
              <bodytext>
                <xsl:apply-templates select="@* | node()"/>
              </bodytext>
            </person:bio.text>
          </person:bio>
        </xsl:when>
        <xsl:otherwise>
          <person:person>
            <person:bio>
              <person:bio.text>
                <bodytext>
                  <xsl:apply-templates select="@* | node()"/>
                </bodytext>
              </person:bio.text>
            </person:bio>
          </person:person>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template bio[not(addl-info)]
    Namespace No namespace
    Match bio[not(addl-info)]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="bio[not(addl-info)]">
      <!--  Original Target XPath:  person:person/person:bio   -->
      <!--  <person:person>-->
      <person:bio>
        <person:bio.text>
          <bodytext>
            <xsl:apply-templates select="@* | node()"/>
          </bodytext>
        </person:bio.text>
      </person:bio>
      <!--</person:person>-->
    </xsl:template>
    Template bio[addl-info]
    Namespace No namespace
    Match bio[addl-info]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="bio[addl-info]">
      <!--  Original Target XPath:  person:person/person:bio   -->
      <!--<person:person>-->
      <person:bio>
        <xsl:apply-templates select="@* | node()"/>
      </person:bio>
      <!--</person:person>-->
    </xsl:template>
    Template addl-info
    Namespace No namespace
    Match addl-info
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="addl-info">
      <!--  Original Target XPath:  person:bio/person:bio.text   -->
      <person:bio.text>
        <bodytext>
          <xsl:apply-templates select="@* | node()"/>
        </bodytext>
      </person:bio.text>
    </xsl:template>
    Template govt-entity
    Namespace No namespace
    Match govt-entity
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="govt-entity">
      <!--  Original Target XPath:  person:person/person:bio/person:bio.text/bodytext/p/text/entity:govt-entity   -->
      <entity:govt-entity>
        <xsl:apply-templates select="@* | node()"/>
      </entity:govt-entity>
    </xsl:template>
    Template role
    Namespace No namespace
    Match role
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="role">
      <!--  Original Target XPath:  person:person/person:bio/person:bio.text/bodytext/p/text/person:person/role   -->
      <role>
        <xsl:apply-templates select="@* | node()"/>
      </role>
    </xsl:template>
    Template person/role
    Namespace No namespace
    Match person/role
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="person/role">
      <role>
        <xsl:apply-templates select="@* | node()"/>
      </role>
    </xsl:template>
    Template text/role
    Namespace No namespace
    Match text/role
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="text/role">
      <xsl:element name="person:person">
        <xsl:element name="role" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:element>
      </xsl:element>
    </xsl:template>
    Template name.text
    Documentation

    Description

     BRT: instruction includes conversion of fnr to footnote. Will not include it here. JL agrees: generic rule should handle this.
                  Same for remotelink. 
    Namespace No namespace
    Match name.text
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="name.text">
      <xsl:choose>
        <xsl:when test="$streamID='USLPA'">
          <xsl:element name="person:person">
            <xsl:element name="person:name.text">
              <xsl:apply-templates select="@* | node()"/>
            </xsl:element>
          </xsl:element>
        </xsl:when>
        <xsl:otherwise>
          <xsl:element name="person:name.text">
            <xsl:apply-templates select="@* | node()"/>
          </xsl:element>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template name.detail
    Namespace No namespace
    Match name.detail
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="name.detail">
      <xsl:element name="person:name.detail">
        <xsl:apply-templates select="@* | node()"/>
      </xsl:element>
    </xsl:template>
    Template name.degree
    Documentation

    Description

     BRT: created and added to base.xsl 
    Namespace No namespace
    Match name.degree
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="name.degree">
      <xsl:element name="person:name.degree">
        <xsl:apply-templates select="@* | node()"/>
      </xsl:element>
    </xsl:template>
    Template name.honorific
    Documentation

    Description

     BRT: created and added to base.xsl 
    Namespace No namespace
    Match name.honorific
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="name.honorific">
      <xsl:element name="person:name.honorific">
        <xsl:apply-templates select="@* | node()"/>
      </xsl:element>
    </xsl:template>
    Template person/@searchtype
    Documentation

    Description

     JD: 2017-07-14: added; note additional handling in /modules/nonamespace/Rosetta_docinfo-LxAdv-doc.metadata_doc.docinfo.xsl 
    Namespace No namespace
    Match person/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="person/@searchtype"/>
    Template case:author/person
    Documentation

    Description

    case:author/person becomes byline/person:contributor populated with a required attribute @contributor-type="author".

    • name.text becomes person:person/person:name.text

    Source XML

    
    <case:author>
        <person>
            <name.text>SAM ROSEWARNE</name.text>
            <role>BARRISTER</role>
        </person>
    </case:author>
    
    	

    Target XML

    
    <byline>
        <person:contributor contributor-type="author">
            <person:person>
                <person:name.text>SAM ROSEWARNE</person:name.text>
                <role>BARRISTER</role>
            </person:person>
        </person:contributor>
    </byline>
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_case.author_person-LxAdv-byline_person.contributor.dita"/> 
     MDS 2017-06-21 - Defined in /case/Rosetta_case.author-to-LexisAdvance_note-byline.xsl 
     JD: 2017-06-28: need to create the person:contributor/person:person wrappers, which is not included in  /case/Rosetta_case.author-to-LexisAdvance_note-byline.xsl 
     MDS 2017-06-29 - The person:contributor/person:person wrapper is too included in the /case/Rosetta_case.author-to-LexisAdvance_note-byline.xsl :-P 
    Namespace No namespace
    Match case:author/person
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="case:author/person">
      <xsl:choose>
        <xsl:when test="child::name.text | child::role and $streamID='AU09'">
          <person:contributor>
            <xsl:attribute name="contributor-type">
              <xsl:text>author</xsl:text>
            </xsl:attribute>
            <person:person>
              <xsl:apply-templates select="@* | node()"/>
            </person:person>
          </person:contributor>
        </xsl:when>
        <xsl:otherwise>
          <person:person>
            <xsl:apply-templates select="@* | node()"/>
          </person:person>
        </xsl:otherwise>
      </xsl:choose>
      <!--  Original Target XPath:  byline/person:contributor   -->
    </xsl:template>
    Template case:author/role
    Documentation

    Description

    case:author/role becomes byline/person:person/role.

    Source XML

    
    <case:author>
        <date>27 October 2000</date>
        <person>
            <name.text>M H WINNEKE</name.text>
        </person>
        <role>Associate to the President</role>
    </case:author>
    
    	

    Target XML

    
    <byline>
        <date>27 October 2000</date>
        <person:person>
            <person:name.text>M H WINNEKE</person:name.text>
            <role>Associate to the President</role>
        </person:person>
    </byline>
    
    	

    Description

    <xsl:template match="name.text">
    
    		<!-\-  Original Target XPath:  person:person/person:name.text   -\->
    		<person:person>
    			<person:name.text>
    				<xsl:apply-templates select="@* | node()"/>
    			</person:name.text>
    		</person:person>
    
    	</xsl:template>
     <topicref href="../../common_newest/Rosetta_case.author_role-LxAdv-byline_person_role.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_case.author_role-LxAdv-byline_person_role.dita  
    Namespace No namespace
    Match case:author/role
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:author/role">
      <!--  Original Target XPath:  byline/person/role   -->
      <person:person>
        <role>
          <xsl:apply-templates select="@* | node()"/>
        </role>
      </person:person>
    </xsl:template>
    Template case:constituent/person
    Documentation

    Description

    case:constituent/person becomes person:counselor/person:person.

    Source XML

    
    <case:constituent>
         <role>Respondent's Counsel:</role> 
         <person>
             <name.text>B Keith and V A Cochrane</name.text>
         </person>
     </case:constituent>
    
    	

    Target XML

    
    <courtcase:counsel>
         <role>Respondent's Counsel:</role>
         <person:counselor>
            <person:person>
                <person:name.text>B Keith and V A Cochrane</person:name.text>
            </person:person>
         </person:counselor>
    </courtcase:counsel>
    
    	

    Description

     <topicref href="../../common_newest/Rosetta_case.constituent_person-LxAdv-person.counselor_person.person.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_case.constituent_person-LxAdv-person.counselor_person.person.dita  
     Vikas Rohilla : Initial updated may be changed if required
    Namespace No namespace
    Match case:constituent/person
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:constituent/person">
      <person:counselor>
        <person:person>
          <xsl:apply-templates select="@* | node()"/>
        </person:person>
      </person:counselor>
    </xsl:template>
    Template pgrp
    Documentation

    Description

    Instructions [common element]

    pgrp becomes pgrp.

    If pgrp comes with following attributes:

    • @id becomes @xml:id
    • @subdoc becomes @includeintoc
    • @toc-caption becomes @alternatetoccaption

    Source XML

    
    <pgrp>
        <heading>
            <title>Background</title>
        </heading>
        <p>
            <pnum count="1">[1]</pnum>
            <text>
                The present applicants are five 
                individuals who at one time or another were engaged by Combined 
                Insurance Company of America (Combined) as insurance agents. 
                In recent times, the five have sued Combined in the 
                Chief Industrial Magistrates&#x2019; Court of New South Wales claiming 
                entitlements both to annual leave and long service leave. 
                One of the principal issues to be resolved in those proceedings is 
                the question of whether the agents were employees of Combined, 
                as they contend, or rather independent contractors, as Combined contends. 
                No doubt the resolution of that issue will involve a close consideration 
                of a broad range of indicia. One of the matters to which 
                Combined points is a term in its contract with each agent by 
                which each agreed, or appears to have agreed, that his relationship 
                with Combined was not one of employment.
            </text>
        </p>
        <p>
            <pnum count="2">[2]</pnum>
            <text>
                That question is, therefore, now pending before the Chief 
                Industrial Magistrates Court. Notwithstanding that circumstance, 
                Combined has commenced the present proceeding in this court 
                seeking three heads of relief:
            </text>
        </p>
    </pgrp>
    
    	

    Target XML

    
    <pgrp>
        <heading>
            <title>Background</title>
        </heading>
        <p>
            <desig value="1" inline="true">[1]</desig>
            <text>
                The present applicants are five 
                individuals who at one time or another were engaged by Combined 
                Insurance Company of America (Combined) as insurance agents. 
                In recent times, the five have sued Combined in the Chief Industrial 
                Magistrates&#x2019; Court of New South Wales claiming entitlements 
                both to annual leave and long service leave. One of the principal 
                issues to be resolved in those proceedings is the question of whether 
                the agents were employees of Combined, as they contend, or rather 
                independent contractors, as Combined contends. No doubt the resolution
                of that issue will involve a close consideration of a broad range of indicia. 
                One of the matters to which Combined points is a term in its contract 
                with each agent by which each agreed, or appears to have agreed, that 
                his relationship with Combined was not one of employment.
            </text>
        </p>
        <p>
            <desig value="2" inline="true">[2]</desig>
            <text>
                That question is, therefore, now pending before the Chief
                Industrial Magistrates Court. Notwithstanding that circumstance,
                Combined has commenced the present proceeding in this court 
                seeking three heads of relief:
            </text>
        </p>  
    </pgrp>
    
    	

    Source XML

    
    <pgrp id="BCA.C5.CHECK">
     <heading>
      <title>Check List for Lease prior to Lodgment (LPI August 2007)</title>
     </heading>
     <!-- ETC. -->
    </pgrp> 
            
        

    Target XML

    
    <pgrp xml:id="BCA.C5.CHECK">
     <heading>
      <title>Check List for Lease prior to Lodgment (LPI August 2007)</title>
     </heading>
     <!-- ETC. -->
    </pgrp> 
            
        

    Source XML

    
    <pgrp subdoc="true" toc-caption="Contributors">
     <heading><title>Authors</title></heading>
     <!-- ETC. -->
    </pgrp> 
            
        

    Target XML

    
    <pgrp includeintoc="true" alternatetoccaption="Contributors">
     <heading><title>Authors</title></heading>
     <!-- ETC. -->
    </pgrp> 
            
        

    Description

     end topichead  person  
     rosetta element: pgrp 
     <topicref href="../../common_newest/Rosetta_pgrp-LxAdv-pgrp.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_pgrp-LxAdv-pgrp.dita  
    <xsl:message>Rosetta_pgrp-LxAdv-pgrp.xsl requires manual development!</xsl:message> 
     BRT: this template is in the otherwise condition in base.xsl, but added the attributes to that template. 
                        This rule is similar to a rule in another topic in which pggrp is converted to pggrp.
                 
    Namespace No namespace
    Match pgrp
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="pgrp">
      <xsl:element name="pgrp">
        <xsl:if test="@id">
          <xsl:apply-templates select="@id"/>
        </xsl:if>
        <xsl:if test="@subdoc">
          <xsl:attribute name="includeintoc">
            <xsl:value-of select="@subdoc"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="@toc-caption">
          <xsl:attribute name="alternatetoccaption">
            <xsl:value-of select="@toc-caption"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:apply-templates/>
      </xsl:element>
    </xsl:template>
    Template pgrp[parent::case:constituents][$streamID=('UK03', 'UK04')]
    Documentation

    Description

     Vikas Rohilla : Template to match the pgrp and the parrent case:constituents and the streamID UK03   
    Namespace No namespace
    Match pgrp[parent::case:constituents][$streamID=('UK03', 'UK04')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="pgrp[parent::case:constituents][$streamID=('UK03', 'UK04')]">
      <courtcase:arguments>
        <bodytext>
          <pgrp>
            <xsl:apply-templates/>
          </pgrp>
        </bodytext>
      </courtcase:arguments>
    </xsl:template>
    Template pgrp[child::link][$streamID='AU18']
    Documentation

    Description

     Satbir : Template for creating textitem as a wrapper of ref:link
    Namespace No namespace
    Match pgrp[child::link][$streamID='AU18']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="pgrp[child::link][$streamID='AU18']">
      <pgrp>
        <xsl:for-each select="node()">
          <xsl:choose>
            <xsl:when test="self::link">
              <textitem>
                <xsl:apply-templates select="self::link"/>
              </textitem>
            </xsl:when>
            <xsl:otherwise>
              <xsl:apply-templates select="."/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each>
      </pgrp>
    </xsl:template>
    Template pnum
    Documentation

    Description

    Instructions [common element]

    pnum becomes desig/ref:para.

    Attribute pnum/@count becomes desig/@value and desig/ref:para/@num and @inline becomes @inline.

    Value of ref:para/@para-scheme is ci:reporter value from ( first ) ci:cite/[@type=”cite4thisdoc”]/ci:case/ci:caseref/ci:reporter.

    ref:para/@para-scheme-type="reporter-abbrev" is hardcoded value.

    Source XML

    <p>
        <pnum count="1">[1]</pnum>
        <text>...</text>
    </p>
    
    and
    
    <ci:cite type="cite4thisdoc">
        <ci:case>
            <ci:caseref>
                <ci:reporter value="urj" />
                <ci:refnum num="BC200000011" />
            </ci:caseref>
        </ci:case>
        <ci:content>
            <citefragment searchtype="CASE-CITE-REF">BC200000011</citefragment>
            <refpt id="BC200000011" type="ext"></refpt>
        </ci:content>
    </ci:cite>
    	

    Target XML

    <p>
        <desig value="1"><ref:para num="1" para-scheme="urj" para-scheme-type="reporter-abbrev">[1]</ref:para></desig>
        <text>...</text>
    </p>
    

    Description

     Awantika: update to create wrapper around pgrp 
    Awantika: Removed this and added it to case:appendix 
     <xsl:template xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" match="pgrp[parent::case:appendix and $streamID='HK03']">
            <xsl:variable name="name" select="local-name()"/>
            
            
            <xsl:if test="local-name(preceding-sibling::*[position()=1]) != $name">
                <bodytext>
                <pgrp>
                    <xsl:apply-templates />
                    
                    <!-\- Match the next sibling if it has the same name -\->
                    <xsl:apply-templates select="following-sibling::*[1][local-name()=$name]" mode="nextpg"/>
                </pgrp>
                </bodytext>
            </xsl:if>
        </xsl:template>
        
        
        <xsl:template match="pgrp" mode="nextpg">
            <xsl:variable name="name" select="local-name()"/>
            <pgrp xmlns="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/"><xsl:apply-templates /></pgrp>
            <xsl:apply-templates select="following-sibling::*[1][local-name()=$name]" mode="nextpg"/>
        </xsl:template>
     rosetta element: pnum 
     <topicref href="../../common_newest/Rosetta_pnum-to-LexisAdvance_desig_ref.para.dita"/> 
      @@@ This file has been autogenerated (although the DITA file already has embedded XSLT).  Remove this comment after manual development complete!  (also remove the embedded XSLT within the DITA above) @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_pnum-to-LexisAdvance_desig_ref.para.dita  
    <xsl:message>Rosetta_pnum-to-LexisAdvance_desig_ref.para.xsl requires manual development!</xsl:message> 
     BRT: This rule is stream-specific and doesn't below in common 
     Awantika: Created this template, one can add streamID if same xpath is required 
    Namespace No namespace
    Match pnum
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="pnum">
      <xsl:if test="$streamID=('HK03','AU01', 'NZ03','CA04','CA01' , 'CA10')">
        <desig>
          <xsl:attribute name="value">
            <xsl:value-of select="@count"/>
          </xsl:attribute>
          <ref:para>
            <xsl:attribute name="num">
              <xsl:value-of select="@count"/>
            </xsl:attribute>
            <xsl:if test="//ci:cite[position()=1]/ci:case/ci:caseref/ci:reporter/@value[1]">
              <xsl:attribute name="para-scheme">
                <!--<xsl:value-of select="(//ci:cite[position()=1]/ci:case/ci:caseref/ci:reporter/@value)[1]"/>-->
                <!-- Awantika:2017-10-30- translated to remove the space and create underscore to get the valid attribute value-->
                <xsl:value-of select="translate((//ci:cite[position()=1]/ci:case/ci:caseref/ci:reporter/@value)[1],' ','_')"/>
              </xsl:attribute>
            </xsl:if>
            <xsl:attribute name="para-scheme-type">reporter-abbrev</xsl:attribute>
            <xsl:apply-templates/>
          </ref:para>
          <!-- Awantika: Duplicate ref:para if case:courtcite/ci:cite/@type="cite4thisdoc" in AU01 and NZ03-->
          <xsl:if test="$streamID=('AU01', 'NZ03') and //case:courtcite[ci:cite[@type='cite4thisdoc']]">
            <ref:para>
              <xsl:attribute name="num">
                <xsl:value-of select="@count"/>
              </xsl:attribute>
              <!--Satbir: Added choose condition for ci:nz because NZ03 contet is not having ci:au markup in source-->
              <xsl:choose>
                <xsl:when test="not((//ci:nz/@courtcode)[1])"/>
                <xsl:otherwise>
                  <xsl:attribute name="para-scheme">
                    <xsl:value-of select="(//ci:nz/@courtcode)[1]"/>
                  </xsl:attribute>
                </xsl:otherwise>
              </xsl:choose>
              <xsl:attribute name="para-scheme-type">
                <xsl:text>court-code</xsl:text>
              </xsl:attribute>
            </ref:para>
          </xsl:if>
        </desig>
      </xsl:if>
    </xsl:template>
    Template refptrefpt-generic
    Documentation

    Description

    Instructions [common element]

    Please note that the conversion of refpt into ref:anchor must follow specific rules based on its location in the source document. These context sensitive aspects are not all discussed in detail in the general instructions given here. Please see the specific document type instructions for more information regarding the context sensitive conversion details of this element. If there is any contradiction between these general instructions and the document type specific instructions, the specific instructions should be given precedence.

    Drop refpt when it occurs as a child of ci:content or case:casename.

    refpt becomes ref:anchor. Attribute @id becomes @id and @type becomes @anchortype with values tokenized as follows:

    • ref:anchor[@anchortype="global"]
    • ref:anchor[@anchortype="local"]

    All occurrences of refpt/@type="ext" should map to ref:anchor/@anchortype="global". If value of refpt/@type="local", or is omitted or any other value the mapping should be ref:anchor/@anchortype="local"

    Note: ref:anchor/@id that begins with a number must have an underscore added at start.

    Duplicate anchors should be suppressed. Repeating anchors are ok however (non duplicate multiple anchors). Need to remove duplicates.

    If refpt comes within l/li/lilabel then ref:anchor will become the first child of listitem.

    entry/refpt becomes entry/ref:anchor

    If refpt comes within figure then drop the refpt since id has dummy values.

    If refpt comes with page as sibling then drop the refpt element.

    If refpt and remotelink occur as adjacent siblings, refer to topic endnote to endnote .

    Note: Whenever an @xml:id has the same value as ANY ref:anchor/@id, suppress the @xml:id.

    Source XML 1

     <case:judgments> <glp:note> <refpt id="257_ALR_1_2"
    					type="ext"/> <remotelink dpsi="000G" refpt="257_ALR_1_1"
    					remotekey1="REFPTID" service="DOC-ID"> Previous page in this case
    					</remotelink> </glp:note> <case:order subdoc="true"
    					toc-caption="Orders"> <heading> <title>Orders</title>
    					</heading> <p> <text> Order that the questions stated in the
    					amended special case be answered as follows: </text> </p>
    					</case:order> </case:judgments> 

    Target XML 1

     <courtcase:opinions> <note> <ref:anchor id="_257_ALR_1_2"
    					anchortype="global"/> ... </note> courtcase:order will be moved under
    					courtcase:body... <courtcase:opinions> 

    Source XML 2

    Here is an example of refpt occurring within ci:content.

     <ci:cite type="cite4thisdoc"> <ci:case> <ci:caseref>
    					<ci:reporter value="urj"/> <ci:refnum num="BC200702133"/>
    					</ci:caseref> </ci:case> <ci:content> <citefragment
    					searchtype="CASE-CITE-REF">BC200702133</citefragment> <refpt
    					id="BC200702133" type="ext"></refpt> </ci:content>
    					</ci:cite> 

    Target XML 2

    When refpt occurs within ci:content, it is dropped.

     <ref:cite4thisresource citetype="reporter"> <lnci:case>
    					<lnci:caseref> <lnci:reporter value="urj"/> <lnci:refnum
    					num="BC200702133"/> </lnci:caseref> </lnci:case>
    					<lnci:content>BC200702133</lnci:content>
    					</ref:cite4thisresource> 

    Source XML 3: Element refpt comes with page element.

     <p> <text> <refpt id="PAGE6" type="ext"/> <page
    					reporter="PBAP" text="Page " count="6"/> In civil trials the position is
    					summarised by Wrottesley, <emph typestyle="it">Principles of
    					Advocacy</emph>, p13: </text> </p> 

    Target XML 3

     <p> <text> <ref:page num="6" page-scheme="PBAP"
    					page-scheme-type="reporter-abbreviation"/> In civil trials the position is
    					summarised by Wrottesley, <emph typestyle="it">Principles of
    					Advocacy</emph>, p13: </text> </p> 

    Description

     start topichead  refpt  
     <topicref href="../../common_newest/Rosetta_refpt-LxAdv-ref.anchor.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_refpt-LxAdv-ref.anchor.dita  
    Namespace No namespace
    Match refpt
    Mode #default
    Used by
    References
    Template
    Import precedence 0
    Source
    <xsl:template match="refpt" name="refpt-generic">
      <!--  Original Target XPath:  ref:anchor   -->
      <xsl:variable name="dup">
        <xsl:call-template name="amIaDuplicate"/>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="parent::leg:bodytext or parent::ci:content or parent::case:casename or ancestor::figure or preceding-sibling::page      or following-sibling::*[1][self::page] or $dup='true'"/>
        <xsl:otherwise>
          <ref:anchor>
            <xsl:apply-templates select="@*"/>
            <xsl:if test="not(@type)">
              <xsl:attribute name="anchortype" select="'local'"/>
            </xsl:if>
            <xsl:if test="node()">
              <ref:anchortext>
                <xsl:apply-templates select="node()"/>
              </ref:anchortext>
            </xsl:if>
          </ref:anchor>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template refpt/@type
    Documentation

    Description

     JL: @id and @xml:id transformations handled by module
    		XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_identifier-LxAdv-ID_data_type-HandlingDuplicates.xsl 
    Namespace No namespace
    Match refpt/@type
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="refpt/@type">
      <!--  Original Target XPath:  @anchortype   -->
      <xsl:attribute name="anchortype">
        <xsl:value-of select="if(.='ext') then 'global' else 'local'"/>
      </xsl:attribute>
    </xsl:template>
    Template case:judgementbody/h/emph/emph[refpt]
    Documentation

    Description

    refpt child of emph to bodytext/p/ref:anchor id-CCCC-10265 case:judgmentbody/h/emph/emph/refpt becomes bodytext/p/ref:anchor. Source XML <case:judgmentbody> ... <h l="3"> <emph typestyle="ro"> <emph typestyle="it"> <refpt id="po.98-984a1" /> 1. The question in issue </emph> </emph> </h> ... </case:judgmentbody> Target XML <bodytext> ... <p> <ref:anchor id="po.98-984a1”> </p> <h> <emph typestyle="ro"> <emph typestyle="it"> 1. The question in issue </emph> </emph> </h> ... </bodytext> Changes 2012-08-30: Created.

    Description

     <topicref href="../../common_newest/Rosetta_Casedoc_refpt-Chof-emph-LxAdv-bodytext_p_ref.anchor.dita"/> 
    Namespace No namespace
    Match case:judgementbody/h/emph/emph[refpt]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judgementbody/h/emph/emph[refpt]">
      <xsl:apply-templates select="node()"/>
    </xsl:template>
    Template case:judgementbody/h/emph[emph/refpt]
    Namespace No namespace
    Match case:judgementbody/h/emph[emph/refpt]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="case:judgementbody/h/emph[emph/refpt]">
      <xsl:apply-templates select="node()"/>
    </xsl:template>
    Template remotelink/@status
    Documentation

    Description

    refpt first child of leg:bodytext to primlaw:level/ref:anchor id-CCCC-10459 If refpt is the immediate child of leg:bodytext then ref:anchor will become the first child of primlaw:level. Source XML <leg:level xml:id="QLD_ACT_1895-15_SD1"> <leg:level-vrnt leveltype="subdoc" subdoc="true" toc-caption="Anglican Church of Australia Act 1895 Amendment Act 1901"> <leg:heading ln.user-displayed="false"> <title align="center"> <emph typestyle="bf"> Anglican Church of Australia Act 1895 Amendment Act 1901 </emph> </title> </leg:heading> <leg:levelbody> <leg:bodytext searchtype="LEGISLATION"> <refpt id="QLD_ACT_1895-15_COMP1" type="ext"/> <refpt id="QLD_ACT_1895-15_SD1" type="ext"/> <p> <text>Queensland</text> </p> </leg:bodytext> ... Target XML <primlaw:level leveltype="unclassified" includeintoc="true" altternatetoccaption="Anglican Church of Australia Act 1895 Amendment Act 1901"> <ref:anchor id="QLD_ACT_1895-15_COMP1" anchortype="global"/> <ref:anchor id="QLD_ACT_1895-15_SD1" anchortype="global"/> <primlaw:bodytext> <p> <text>Queensland</text> </p> </primlaw:bodytext> </primlaw:level> Changes 2012-08-30: Created.

    Description

    If refpt occurs under level/heading/edpnum then ref:anchor will become the first child of admindoc:level.

    Source XML

    
                                     

    Target XML

    
                                     
                                     

    Description

    refpt child of level/heading/title to seclaw:level/ref:anchor, primlaw:level/ref:anchor and section/ref:anchor id-CCCC-10454 If refpt is a child of level/heading/title then ref:anchor will become the first child of seclaw:level, primlaw:level and section depending on the target schema. AU Commentary-Form-Precedents: If refpt is a child of level/heading/edpnum and refpt element has text then ref:anchor will become the first child of seclaw:level and refpt text will retain seclaw:level/heading/altdesig Source XML <level id="ABCA_ASICA_ACT.SGM_ABCA.ASICA.PT1" leveltype="comm.chap"> <heading searchtype="COMMENTARY"> <title> <refpt type="ext" id="ABCA.ASICA.PT1"/> Part 1 &mdash; Preliminary [ss 1&ndash;6] </title> </heading> ... Target XML <seclaw:level xml:id="ABCA_ASICA_ACT.SGM_ABCA.ASICA.PT1" leveltype="unclassified"> <ref:anchor id="ABCA.ASICA.PT1" anchortype="global"/> <heading> <title>Part 1 &#x2014; Preliminary [ss 1&#x2013;6]</title> </heading> ... Source XML <level id="BCA.C2.AGRP1.ATTJ" leveltype="attachment" subdoc="false" toc-caption="[14,090] Attachment J Deed of Subcontractor's Warranty"> <heading> <edpnum> <refpt id="BCA.C2.AGRP1.ATTJ" type="ext">[14,090]</refpt> </edpnum> <desig><designum>Attachment J</designum></desig> <title>Deed of Subcontractor's Warranty</title> </heading> ... Target XML <seclaw:level leveltype="attachment" toc-caption="&#x005B;14,090&#x005D; Attachment J Deed of Subcontractor&#x0027;s Warranty"> <ref:anchor id="BCA.C2.AGRP1.ATTJ" anchortype="global"/> <heading> <altdesig>&#x005B;14,090&#x005D;</altdesig> <desig>Attachment J</desig> <title>Deed of Subcontractor&#x0027;s Warranty</title> </heading> ... Changes 2012-08-30: Created 2012-12-07: Instruction and Example added: refpt has text.

    Description

    refpt child of p/text/emph to p/ref:anchor id-CCCC-10457 p/text/emph/refpt becomes p/ref:anchor. All occurrences of refpt[@type="ext"] should map to ref:anchor[@anchortype="global"]. If value of refpt[@type="local"], or is omitted or any other value the mapping should be ref:anchor[@anchortype="local"]. If any text comes under the refpt then conversion needs to map in target ref:anchor/ref:anchortext. (i.e. p/text/emph/refpt becomes p/ref:anchor/ref:anchortext). Source XML <p> <text> <emph> <refpt id="x98-525a1"/> Section 115 contains the general right of appeal given to a defendant in proceedings governed by the Summary Proceedings Act. ... </emph> </text> </p> Target XML <p> <ref:anchor id="x98-525a1" anchortype="local"/> <text> Section 115 contains the general right of appeal given to a defendant in proceedings governed by the Summary Proceedings Act. ... </text> </p> Changes 2016-07-27: Added a note for handling of text which is comes under the refpt in source. 2013-10-11: Added a note and update the target examples when refpt comes without attribute [@type="ext"] and [@type="local"] in source documents. 2012-08-30: Created.

    Description

    Instructions [common element]

    Note: This topic is used in numerous conversion instructions for several LBUs. It is a shared topic rather than duplicated to ensure consistency and accuracy. The xml snippets contained in this topic reflect markup needed for the Apollo image handling application. The UK is the first LBU to move from Apollo to the Blobstore application for image handling. Therefore, if this is a UK conversion instruction document, please refer to the following topics for correct image handling markup.

    • lnlink[@service="ATTACHMENT"] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10542)
    • inlineobject to ref:inlineobject for BLOBSTORE images (id-CCCC-10540)
    • link[@filename] to ref:lnlink[@service="ATTACHMENT"] for BLOBSTORE images (id-CCCC-10541)

    Regardless of which of the use cases described below occurs, the attribute remotelink/@status is always suppressed, it is never output to the target document.

    • Use case: remotelink[@service='SEARCH']. The service type "SEARCH" is not supported in New Lexis. Unless remotelink[@hrefclass='http'] it is recommended that such remotelink elements be copied into an xml comment. This retains the content for future analysis without creating unsupported target markup. The risk of this approach is the loss of ref:marker text content from display to the user. If there is a remotelink/@hrefclass] attribute equal to "http" then the remotelink is not copied into a comment but is instead converted to either a url or ref:lnlink, see below for details.
    • Use case: remotelink[@service='QUERY']:
      • In General, convert the pcdata, but suppress the remotelink tag and its attributes.
      • For the following exceptional contexts, do not convert the pcdata of remotelink[@service="QUERY"]. Instead, suppress both the pcdata and remotelink markup:

      A corresponding product requirement shall be created with an instruction to build the link on retrieval based on semantic markup in the document.

    • Use case: remotelink[@service='DOC-ID'] becomes ref:crossreference with required child ref:content and attribute remotelink/@xml:lang becomes ref:content/@xml:lang. For multiple, immediate, sibling occurrences without intermediary text, group within a ref:crossreferencegroup parent except for lnci:content and title.
      • The value of ref:crossreference/@crossreferencetype should be set to "seeAlso".
      • Create ref:crossreference/ref:locator/ref:locator-key with attributes and children as follows:

        • If @remotekey1="DOC-ID" or @remotekey1="DOCID" then
          • ref:key-name/@name will have the value "DOC-ID".
          • key-value/@value will be the value of @dpsi followed by hyphen and concatenated with @refpt or @remotekey2, which ever is present (if both are present, use @remotekey2).
        • If @remotekey1="REFPTID" or @remotekey1="REFPT" then
          • ref:key-name/@name will have the value "DOC-ID".
          • ref:key-value/@value will be the value of @dpsi followed by hyphen and concatenated with @docidref.
          • Create ref:locator/@anchoridref with value from @refpt or @remotekey2, which ever is present (if both are present, use @refpt). If @refpt is empty or only whitespace, do not output a @anchoridref.

        Note: If remotelink/@dpsi is not present, use value from docinfo:dpsi/@id-string or capture value from the LBU manifest file.

        Note: ref:locator/@anchoridref that begins with a number must have an underscore added at start. Also apply other identifier data type format as used for xml:id and ref:anchor/@id (e.g. change colon to underscore). Refer to the section titled "Identifiers to ID Data Type - Handling Pattern Restrictions", if that section exists in this CI.

    • Use case: remotelink[@service='URL'] or remotelink[@hrefclass='http'][@href] or remotelink[@href] and the data content of the remotelink is a URL. That is, the data content of remotelink starts with text such as "http://...", "https://...", "www.some.domain", or is of type (http | https | nohttp | mailto | ftp). In this case, remotelink becomes url, and populated as follows:
      • If the remotelink/@hrefclass attribute is present in the source document, the remotelink[@hrefclass="http"] becomes url and @href becomes @normval. The value of the attribute @hrefclass is prepended to the value of @href with the addition of '://' to form the @normval.

        • Exception: If content of @hrefclass is already present in @href then do not concatenate. Populate @normval with content of @href.
      • When remotelink/@hrefclass does not exist in remotelink then nothing will be prepended to the @href value. That is, remotelink with @href attribute but no @hrefclass attribute converts to url where the @normval attribute is set to remotelink/@href.

    • Use case: remotelink[@service='URL'] or remotelink[@hrefclass='http'][@href] but the data content of the remotelink is not a URL. That is, the data content of remotelink does not start with text such as "http://...", "https://...", "www.some.domain", nor is it of type (http | https | nohttp | mailto | ftp). In this case, remotelink becomes ref:lnlink with children ref:marker and ref:locator, populated as follows:
    • The ref:lnlink/@service attribute is set to "URL".
    • The contents of remotelink becomes the contents of child ref:lnlink/ref:marker. Any subelements (such as emph and inlineobject) are converted as described elsewhere by instructions given for those specific elements.
    • The child ref:lnlink/ref:locator is created, and within it the child ref:lnlink/ref:locator/ref:locator-key is created, and within it the children ref:lnlink/ref:locator/ref:locator-key/ref:key-name and ref:lnlink/ref:locator/ref:locator-key/ref:key-value are created.
    • The ref:key-name/@name attribute is set to "URL".
    • If the remotelink/@hrefclass attribute is present, ref:key-value/@value is set to the combined value of remotelink/@hrefclass, followed by "://", followed by the value of remotelink/@href.
      • Exception: If content of @hrefclass is already present in @href then do not concatenate. Populate @value with content of @href.
    • If the remotelink/@hrefclass attribute is not present, ref:key-value/@value is set to the value of remotelink/@href.
    • Use case: remotelink[@href]
    • If remotelink doesn't have any attributes, then remotelink should be suppressed, but any elements contained within remotelink should be processed according to the appropriate instructions.

    Note:

    In the source documents, remotelink is used for two distinct purposes:

    • To create an inter-document link; a link to a location outside the containing document.
    • To create link for a traditional URL.

    If refpt and remotelink occurs as adjacent siblings then refer to the instructions for converting endnote.

    Note: Exception for NZ17CC: When remotelink is a child of emph then conversion should suppress emph element only and process remotelink as per above instruction. See example 17.

    Source XML 1: showing service type "DOC-ID" converted to ref:crossreference.

    					
    	<remotelink service="DOC-ID" remotekey1="DOC-ID" dpsi="0062"
    				refpt="QLD_ACT_1992-48_20050831">31/8/2005 to
    				18/11/2005</remotelink>
    
    				

    Target XML 1

    				                              
    	<ref:crossreference crossreferencetype="seeAlso">                                        
    		<ref:content>31/8/2005 to 18/11/2005</ref:content>                                        
    			<ref:locator>                                            
    				<ref:locator-key>
    					<ref:key-name name="DOC-ID"/>
    					<ref:key-value value="0062-QLD_ACT_1992-48_20050831"/>
    				</ref:locator-key>		
    			</ref:locator>                                 
    	</ref:crossreference>
    			

    Source XML 2: showing remotelink/@xml:lang.

    				
    <remotelink dpsi="03JC" remotekey1="DOC-ID" remotekey2="currentness" 
    service="DOC-ID" xml:lang="en">Current&#x20;to&#x20;June&#x20;23,&#x20;2012</remotelink>
    
    				

    Target XML 2

    				                              
    	<ref:crossreference>                                        
    		<ref:content xml:lang="en">Current&#x20;to&#x20;June&#x20;23,&#x20;2012</ref:content>
        <ref:locator>
          <ref:locator-key>
             <ref:key-name name="DOC-ID"/>
             <ref:key-value value="03JC-currentness"/>
         </ref:locator-key>
       </ref:locator>                                 
    	</ref:crossreference>
    				

    Source XML 3: showing service type "DOC-ID" converted to ref:crossreference (multiple, immediate siblings).

    				           
    <remotelink service="DOC-ID" remotekey1="REFPTID" dpsi="0062" docidref="ABCD_5641"      
                refpt="QLD_ACT_1992-48_20050831">31/8/2005 to
                18/11/2005</remotelink>
    <remotelink service="DOC-ID" remotekey1="DOC-ID" dpsi="0000"
                refpt="QLD_ACT_1992-48_00000000">31/8/2005 to
                18/11/2005</remotelink>
    <remotelink service="DOC-ID" remotekey1="REFPTID" dpsi="1111" docidref="EFGH_2468"  
                refpt="QLD_ACT_1992-48_11111111">31/8/2005 to
                18/11/2005</remotelink>
    
    				

    Target XML 3

    				
    <ref:crossreferencegroup>
    	<ref:crossreference crossreferencetype="seeAlso">                                        
    		<ref:content>31/8/2005 to 18/11/2005</ref:content>                                        
    			<ref:locator anchoridref="QLD_ACT_1992-48_20050831">                                             
    				<ref:locator-key>
    					<ref:key-name name="DOC-ID"/>
    					<ref:key-value value="0062-ABCD_5641"/>
    				</ref:locator-key>			
    			</ref:locator>                                 
    	</ref:crossreference>
    	<ref:crossreference crossreferencetype="seeAlso">                                        
    		<ref:content>31/8/2005 to 18/11/2005</ref:content>                                        
    			<ref:locator>                                            
    				<ref:locator-key>
    					<ref:key-name name="DOC-ID"/>
    					<ref:key-value value="0000-QLD_ACT_1992-48_00000000"/>
    				</ref:locator-key>			
    			</ref:locator>                                 
    	</ref:crossreference>
    	<ref:crossreference crossreferencetype="seeAlso">                                        
    		<ref:content>31/8/2005 to 18/11/2005</ref:content>                                        
    			<ref:locator anchoridref="QLD_ACT_1992-48_11111111">                                            
    				<ref:locator-key>
    					<ref:key-name name="DOC-ID"/>
    					<ref:key-value value="1111-EFGH_2468"/>
    				</ref:locator-key>	
    			</ref:locator>                                 
    	</ref:crossreference>
    </ref:crossreferencegroup>
    				

    Source XML 4: showing remotelink/sup

    				
    <remotelink remotekey1="REFPTID" service="DOC-ID" dpsi="0062" docidref="ABCD_5641" refpt="VIC_ACT_6231_FN31">
    <sup>31</sup>
    </remotelink>
    
    				

    Target XML 4

    				
    <ref:crossreferencegroup>
    	<ref:crossreference crossreferencetype="seeAlso">
    		<ref:content><sup>31</sup></ref:content>
    			<ref:locator anchoridref="VIC_ACT_6231_FN31">                                                
    				<ref:locator-key>
    					<ref:key-name name="DOC-ID"/>
    					<ref:key-value value="0062-ABCD_5641"/>
    				</ref:locator-key>                                                    
    			</ref:locator>                                 
    	</ref:crossreference>                                    
    </ref:crossreferencegroup>
    
    				

    Source XML 5: for link to URL, with URL as content

    				
    <remotelink href="www.statedevelopment.qld.gov.au" hrefclass="http" newwindow="YES">www.statedevelopment.qld.gov.au</remotelink>
    
    <!-- The following illustrates scenario where content of @hrefclass is already present in @href and so values are not concatenated for target -->
    
    <remotelink href="http://www.acmecorp.com" hrefclass="http" newwindow="YES">www.acmecorp.com</remotelink>
    
    				

    Target XML 5: for link to URL, with URL as content

    				
    <url normval="http://www.statedevelopment.qld.gov.au">www.statedevelopment.qld.gov.au</url>
    
    <url normval="http://www.acmecorp.com">www.acmecorp.com</url>
    
    				

    Note: As shown here in Example 6, the use of an @href attribute without @hrefclass, where the @href attribute does not itself contain an hrefclass, ("http://" for example), is not advised because the resulting @normval would not contain the hrefclass. Normalized values should be consistent in providing the href class. The link to the target may not work.

    Source XML 6: for link to URL with no hrefclass attribute, and with URL as content

    				
    <remotelink href="www.asx.com" newwindow="YES" service="SEARCH">www.asx.com</remotelink>
    
    				

    Target XML 6: for link to URL with no hrefclass attribute, and with URL as content

    				
    <url normval="www.asx.com">www.asx.com</url>
    
    				

    Source XML 7: for link to URL, with non-URL text content

    				
    <remotelink href="www.asx.com" hrefclass="http" newwindow="YES" service="SEARCH" status="valid">Australian Securities Exchange (ASX)</remotelink>
    
    <!-- The following illustrates scenario where content of @hrefclass is already present in @href and so values are not concatenated for target -->
    
    <remotelink href="http://www.acmecorp.com" hrefclass="http" newwindow="YES">Acme Corporation</remotelink>
    
    				

    Target XML 7: for link to URL, with non-URL text content

    				
    <ref:lnlink service="URL">
      <ref:marker>Australian Securities Exchange (ASX)</ref:marker>
      <ref:locator>
        <ref:locator-key>
          <ref:key-name name="URL"/>
          <ref:key-value value="http://www.asx.com"/>
        </ref:locator-key>
      </ref:locator>
    </ref:lnlink>
    
    <ref:lnlink service="URL">
      <ref:marker>Acme Corporation</ref:marker>
      <ref:locator>
        <ref:locator-key>
          <ref:key-name name="URL"/>
          <ref:key-value value="http://www.acmecorp.com"/>
        </ref:locator-key>
      </ref:locator>
    </ref:lnlink>
    
    				

    Note: Please note that XML comments need to be added around markup ref:marker if it is in ref:lnlink@service=”URL”and the ref:key-value@value starts-with ('http://www.lexisnexis.com/au/legal/api'). Please see the below target xml for more details.

    Source XML 7a: for link to URL, with non-URL text content

    
        <remotelink href=”www.lexisnexis.com/au/legal/api/version1/sr?csi=357205&sr=FILE%2DCODE(%28%23LL00093CF%23+OR+%23LL000CQNJ%23%29)&shr=T&oc=00254"
     hrefclass="http" newwindow="YES" service="SEARCH" status="valid">Search LexisNexisAU</remotelink>
    
    		  

    Target XML 7a: for link to URL, with non-URL text content

    
    <ref:lnlink service="URL">
      <!--<ref:marker>Search LexisNexisAU</ref:marker>-->
      <ref:locator>
        <ref:locator-key>
          <ref:key-name name="URL"/>
          <ref:key-value value="http://www.lexisnexis.com/au/legal/api/version1/sr?csi=357205&sr=FILE%2DCODE(%28%23LL00093CF%23+OR+%23LL000CQNJ%23%29)&shr=T&oc=00254"/>
        </ref:locator-key>
      </ref:locator>
    </ref:lnlink>
    
    		  

    Source XML 8: for link to URL with no hrefclass attribute, and with non-URL text content

    				
    <remotelink href="http://www.legislation.vic.gov.au/Domino/Web_Notes/LDMS/PubStatbook.nsf/b05145073fa2a882ca256da4001bc4e7/DDB2D286D7B9C8E2CA2578C6001CCC82/$FILE/11-058sr%20authorised.pdf" service="URL" newwindow="YES">Government Website</remotelink>
    
    				

    Target XML 8: for link to URL with no hrefclass attribute, and with non-URL text content

    				
    <ref:lnlink service="URL">
      <ref:marker>Government Website</ref:marker>
      <ref:locator>
        <ref:locator-key>
          <ref:key-name name="URL"/>
          <ref:key-value value="http://www.legislation.vic.gov.au/Domino/Web_Notes/LDMS/PubStatbook.nsf/b05145073fa2a882ca256da4001bc4e7/DDB2D286D7B9C8E2CA2578C6001CCC82/$FILE/11-058sr%20authorised.pdf"/>
        </ref:locator-key>
      </ref:locator>
    </ref:lnlink>
    
    				

    • If remotelink[@service= ‘DOC-ID’] is a child of glp:note; glp:note becomes note/bodytext/p/text, remotelink[@service= ‘DOC-ID’] becomes ref:crossreference (see conversion rules in remotelink section).

    Source XML 9:

    
    <glp:note>
        <remotelink dpsi="006P" refpt="AFL.FL.FLA75.PT1_2" remotekey1="REFPTID" service="DOC-ID"  docidref="ABCD_5641" status="unval">
            Next page in this legislation
        </remotelink>
    </glp:note>
    
    		  

    Target XML 9

    
    <note>
        <bodytext>
            <p>
                <text>					                            
                    <ref:crossreference crossreferencetype="seeAlso">                                        
                        <ref:content>Next page in this legislation</ref:content>                                        
                        <ref:locator anchoridref="AFL.FL.FLA75.PT1_2">                                            
                            <ref:locator-key>
                                <ref:key-name name="DOC-ID"/>
                                <ref:key-value value="006P-ABCD_5641"/>
                            </ref:locator-key>		
                        </ref:locator>                                 
                    </ref:crossreference>                             
                </text>
            </p>
        </bodytext>
    </note>
    
    		  

    Source XML 10: remotelink as a child of ci:cite/ci:content

    			
          <ci:cite searchtype="LEG-REF">
            <ci:content>
              <remotelink refpt="CTH_ACT_1993-80" dpsi="005X" docidref="ABCD_9876" 
                remotekey1="REFPTID" service="DOC-ID" 
                alttext="Click to link to LawNow Legislation">Superannuation (Resolution of Complaints) Act 1993</remotelink>.
            </ci:content>
          </ci:cite>			
    			
    			

    Target XML 10: remotelink as a child of ci:cite/ci:content

    
    <lnci:cite type="legislation">
        <lnci:content>
            <ref:crossreference crossreferencetype="seeAlso">
                <ref:content>Superannuation (Resolution of Complaints) Act 1993</ref:content>
                <ref:locator anchoridref="CTH_ACT_1993-80">
                    <ref:locator-key>
                        <ref:key-name name="DOC-ID"/>  
                        <ref:key-value value="005X-ABCD_9876"/>
                    </ref:locator-key>
                </ref:locator>
            </ref:crossreference>
        </lnci:content>
    </lnci:cite>			
    
    			

    Source XML 11: remotelink as a child of title

    				
    <level id="ACLPP_C1.SGM_ACLP.1.2.0015" leveltype="para0" toc-caption="[1.2.0015] Interpretation rules applicable to the Corporations Act: Pt&#x00A0;1.2" subdoc="true">
        <!-- ETC. -->
        <heading searchtype="COMMENTARY">
            <edpnum>
                <refpt type="ext" id="ACLP.1.2.0015"></refpt>[1.2.0015]</edpnum>
            <title>Interpretation rules applicable to the Corporations Act:
                <remotelink refpt="ACLL.CL.PT1-2" dpsi="006K" remotekey1="REFPTID" service="DOC-ID"  docidref="EFGH_2468">Pt&#x00A0;1.2</remotelink>
            </title>
        </heading>
        <bodytext searchtype="COMMENTARY">
            <!-- ETC. -->
        </bodytext>
    </level>
    				

    Target XML 11: remotelink as a child of title

    				
    <seclaw:level xml:id="ACLPP_C1.SGM_ACLP.1.2.0015" leveltype="paragraph" alternatetoccaption="&#x005B;1.2.0015&#x005D; Interpretation rules applicable to the Corporations Act: Pt&#x00A0;1.2" includeintoc="true">
        <ref:anchor id="ACLP.1.2.0015" anchortype="global"/>
        <heading>
            <desig>&#x005B;1.2.0015&#x005D;</desig>
            <title>Interpretation rules applicable to the Corporations Act: <ref:crossreferencegroup>
                        <ref:crossreference crossreferencetype="seeAlso">
                            <ref:content>Pt&#x00A0;1.2</ref:content>
                            <ref:locator anchoridref="ACLL.CL.PT1-2">
                                <ref:locator-key>
                                    <ref:key-name name="DOC-ID"/>
                                    <ref:key-value value="006K-EFGH_2468"/>
                                </ref:locator-key>
                            </ref:locator>
                        </ref:crossreference>
                    </ref:crossreferencegroup></title>
        </heading>
        <!-- ETC. -->
        <seclaw:bodytext>
            <!-- ETC. -->
        </seclaw:bodytext>
    </seclaw:level>
    				

    Source XML 12: remotelink with no attributes

    
    <remotelink><emph typestyle="smcaps">agency</emph></remotelink>
    
    				

    Target XML 12: remotelink with no attributes

    
    <emph typestyle="smcaps">agency</emph>
    
    				

    Source XML 13: for link to URL with inlineobject as content

    				
    <remotelink href="www.kpmg.com.au/default.aspx?tabid=145" hrefclass="http" newwindow="YES">
      <inlineobject type="image" attachment="ln-server" filename="kpmglogo.gif"/>
    </remotelink>
    
    				

    Target XML 13: for link to URL with inlineobject as content

    				
    <ref:lnlink service="URL">
      <ref:marker>
        <ref:inlineobject>
          <ref:locator>
            <ref:locator-key>
                <ref:key-name name="object-key"/>
                <ref:key-value value="X-Y-kpmglogo"/>   <!-- X and Y are LNI and SMI values obtained from CSSM -->
            </ref:locator-key>
            <ref:locator-params>
                <proc:param name="componentseq" value="1"/>
                <proc:param name="object-type" value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)-->
                <proc:param name="object-smi" value=""/>    <!-- This @value assignment is done by conversion program -->
            </ref:locator-params>
          </ref:locator>
        </ref:inlineobject>
      </ref:marker>
      <ref:locator>
        <ref:locator-key>
          <ref:key-name name="URL"/>
          <ref:key-value value="http://www.kpmg.com.au/default.aspx?tabid=145"/>
        </ref:locator-key>
      </ref:locator>
    </ref:lnlink>
    
    				

    Source XML 14: emph as child of remotelink

    
        <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="04M2_1_1662:HTCOMM-PARAGRAPH" dpsi="04M2">
               HEC <emph typestyle="bf">[1662]</emph>
         </remotelink>
    
    				

    Source XML 14: emph as child of remotelink

    				
     <ref:crossreference crossreferencetype="seeAlso">                                        
    		<ref:content>HEC <emph typestyle="bf">[1662]</emph></ref:content>                                        
    			<ref:locator anchoridref="04M2_1_1662:HTCOMM-PARAGRAPH">                                             
    				<ref:locator-key>
    					<ref:key-name name="DOC-ID"/>
    					<ref:key-value value="04M2-ABC"/>
    				</ref:locator-key>			
    			</ref:locator>                                 
    	</ref:crossreference>
    
    				

    Source XML 15: remotelink occurs as multiple, immediate siblings and without intermediary text within title

    
    <leg:level>
     <leg:level-vrnt leveltype="prov1">
      <leg:heading>
       <title><refpt id="EU_LEGISLATION:31998L0096R_02:" type="ext"/>Corrigendum to Council <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="EU_LEGISLATION:Directive_98_96_EC_" dpsi="08LU" docidref="08LU_EU_LEGISLATION:Directive_98_96_EC_">Directive 98/96/EC</remotelink> of 14 December 1998 amending, inter alia, as regards unofficial field inspections under <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="EU_LEGISLATION:Directives_66_400_EEC__" dpsi="08LU" docidref="08LU_EU_LEGISLATION:Directives_66_400_EEC__">Directives 66/400/EEC, </remotelink>66/401/EEC, 66/402/EEC, 66/403/EEC, 69/208/EEC, 70/457/EEC and 70/458/EEC on the marketing of beet seed, fodder plant seed, cereal seed, seed potatoes, seed of oil and fibre plants and vegetable seed and on the common catalogue of varieties of agricultural plant species (OJ L 25 of 1.2
       <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="EU_LEGISLATION:_EEC__66_401" dpsi="08LU" docidref="08LU_EU_LEGISLATION:_EEC__66_401">/EEC, 66/401</remotelink>
       <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="EU_LEGISLATION:_EEC__66_402" dpsi="08LU" docidref="08LU_EU_LEGISLATION:_EEC__66_402">/EEC, 66/402</remotelink>
       <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="EU_LEGISLATION:_EEC__66_403" dpsi="08LU" docidref="08LU_EU_LEGISLATION:_EEC__66_403">/EEC, 66/403</remotelink>
       <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="EU_LEGISLATION:_EEC__69_208" dpsi="08LU" docidref="08LU_EU_LEGISLATION:_EEC__69_208">/EEC, 69/208</remotelink>
       <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="EU_LEGISLATION:_EEC__70_457" dpsi="08LU" docidref="08LU_EU_LEGISLATION:_EEC__70_457">/EEC, 70/457</remotelink>/EEC and
       <remotelink service="DOC-ID" remotekey1="REFPTID" refpt="EU_LEGISLATION:_70_458" dpsi="08LU" docidref="08LU_EU_LEGISLATION:_70_458"> 70/458</remotelink>/EEC on the marketing of beet seed, fodder plant seed, cereal seed, seed potatoes, seed of oil and fibre plants and vegetable seed and on the common catalogue of varieties of agricultural plant species (OJ L 25 of 1.2.1999)</title>
      </leg:heading>
      <!-- ETC. -->
     </leg:level-vrnt>
    </leg:level>
    		  

    Target XML 15: remotelink occurs as multiple, immediate siblings and without intermediary text within title

    
    <primlaw:level leveltype="section">
     <heading>
      <title>Corrigendum to Council <ref:crossreference crossreferencetype="seeAlso"><ref:content>Directive 98/96/EC </ref:content><ref:locator anchoridref="EU_LEGISLATION_Directive_98_96_EC_"><ref:locator-key><ref:key-name name="DOC-ID"/><ref:key-value value="08LU-08LU_EU_LEGISLATION_Directive_98_96_EC_"/></ref:locator-key></ref:locator></ref:crossreference> of 14 December 1998 amending, inter alia, as regards unofficial field inspections under <ref:crossreference crossreferencetype="seeAlso"><ref:content>Directives 66/400/EEC, </ref:content><ref:locator anchoridref="EU_LEGISLATION_Directives_66_400_EEC__"><ref:locator-key><ref:key-name name="DOC-ID"/><ref:key-value value="08LU-08LU_EU_LEGISLATION_Directives_66_400_EEC__"/></ref:locator-key></ref:locator></ref:crossreference>66/401/EEC, 66/402/EEC, 66/403/EEC, 69/208/EEC, 70/457/EEC and 70/458/EEC on the marketing of beet seed, fodder plant seed, cereal seed, seed potatoes, seed of oil and fibre plants and vegetable seed and on the common catalogue of varieties of agricultural plant species (OJ L 25 of 1.2
       <ref:crossreference crossreferencetype="seeAlso">
        <ref:content>/EEC, 66/401</ref:content>
        <ref:locator anchoridref="EU_LEGISLATION__EEC__66_401">
         <ref:locator-key>
          <ref:key-name name="DOC-ID"/>
          <ref:key-value value="08LU-08LU_EU_LEGISLATION__EEC__66_401"/>
         </ref:locator-key>
        </ref:locator>
       </ref:crossreference>
       <ref:crossreference crossreferencetype="seeAlso">
        <ref:content>/EEC, 66/402</ref:content>
        <ref:locator anchoridref="EU_LEGISLATION__EEC__66_402">
         <ref:locator-key>
          <ref:key-name name="DOC-ID"/>
          <ref:key-value value="08LU-08LU_EU_LEGISLATION__EEC__66_402"/>
         </ref:locator-key>
        </ref:locator>
       </ref:crossreference>
       <ref:crossreference crossreferencetype="seeAlso">
        <ref:content>/EEC, 66/403</ref:content>
        <ref:locator anchoridref="EU_LEGISLATION__EEC__66_403">
         <ref:locator-key>
          <ref:key-name name="DOC-ID"/>
          <ref:key-value value="08LU-08LU_EU_LEGISLATION__EEC__66_403"/>
         </ref:locator-key>
        </ref:locator>
       </ref:crossreference>
       <ref:crossreference crossreferencetype="seeAlso">
        <ref:content>/EEC, 69/208</ref:content>
        <ref:locator anchoridref="EU_LEGISLATION__EEC__69_208">
         <ref:locator-key>
          <ref:key-name name="DOC-ID"/>
          <ref:key-value value="08LU-08LU_EU_LEGISLATION__EEC__69_208"/>
         </ref:locator-key>
        </ref:locator>
       </ref:crossreference>
       <ref:crossreference crossreferencetype="seeAlso">
        <ref:content>/EEC, 70/457</ref:content>
        <ref:locator anchoridref="EU_LEGISLATION__EEC__70_457">
         <ref:locator-key>
          <ref:key-name name="DOC-ID"/>
          <ref:key-value value="08LU-08LU_EU_LEGISLATION__EEC__70_457"/>
         </ref:locator-key>
        </ref:locator>
       </ref:crossreference>/EEC and
       <ref:crossreference crossreferencetype="seeAlso">
        <ref:content> 70/458</ref:content>
        <ref:locator anchoridref="EU_LEGISLATION__70_458">
         <ref:locator-key>
          <ref:key-name name="DOC-ID"/>
          <ref:key-value value="08LU-08LU_EU_LEGISLATION__70_458"/>
         </ref:locator-key>
        </ref:locator>
       </ref:crossreference>/EEC on the marketing of beet seed, fodder plant seed, cereal seed, seed potatoes, seed of oil and fibre plants and vegetable seed and on the common catalogue of varieties of agricultural plant species (OJ L 25 of 1.2.1999)</title>
      </heading>
      <!-- ETC. -->
    </primlaw:level>  
    
    		  

    Source XML 16: remotelink[@service="QUERY"]

    
    <p>
        <text>Consultation Paper: The Award of Costs from Central Funds in Criminal
            Cases - <remotelink service="QUERY"
                remotekey1="DIGEST-CITATION(LNB News 06/11/2008 25)"
                remotekey2="All Subscribed Current Awareness Sources" cmd="f:exp"
                alttext="References to">LNB News 06/11/2008 25</remotelink>; </text>
    </p>
    
    	

    Target XML 16: remotelink[@service="QUERY"]

    
    <p>
        <text>Consultation Paper: The Award of Costs from Central Funds in Criminal
            Cases - LNB News 06/11/2008 25; </text>
    </p>
    
    	

    Source XML 17: remotelink as a child of emph

    <ci:cite searchtype="LEG-REF">
        <ci:content>
            <citefragment searchtype="LEG-NAME-REF">
                <emph typestyle="it">
                    <remotelink dpsi="0069" remotekey1="REFPTID" service="DOC-ID" refpt="1952A52"
                        docidref="1952A52.BODY">Land Transfer Act 1952</remotelink>
                </emph>
            </citefragment>
            <emph typestyle="it">, ss 62, 105 and 119</emph>
        </ci:content>
    </ci:cite>
    	

    Target XML 17: remotelink as a child of emph

    <lnci:cite type="legislation">
        <lnci:content>
                <ref:crossreference crossreferencetype="seeAlso">
                    <ref:content>Land Transfer Act 1952</ref:content>
                    <ref:locator anchoridref="_1952A52">
                        <ref:locator-key>
                            <ref:key-name name="DOC-ID"/>
                            <ref:key-value value="0069-1952A52.BODY"/>
                        </ref:locator-key>
                    </ref:locator>
                </ref:crossreference>
            <emph typestyle="it">, ss 62, 105 and 119</emph>
        </lnci:content>
    </lnci:cite>
    	

    Description

     <topicref href="../../common_newest/Rosetta_refpt_firstChildOf_leg.bodytext-LxAdv-primlaw.level_ref.anchor.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
     <xsl:message>Requires manual development!</xsl:message> 
     20170512:  MCJ:  This is a do nothing module. 
     Awantika: Not in GDS 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_refpt-Chof-case.body_heading_edpnum-LxAdv-casedigest.body_ref.anchor.dita"/> 
    <xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-case.body_heading_edpnum-LxAdv-casedigest.body_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.endmatter_index_heading_title-LxAdv-primlaw.level_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.endmatter_index_heading_title-LxAdv-primlaw.level_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.histcite_heading_title-LxAdv-primlawhist.histgrp_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.histcite_heading_title-LxAdv-primlawhist.histgrp_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.history_heading_title-LxAdv-primlawhist.primlawhist_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.history_heading_title-LxAdv-primlawhist.primlawhist_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.level_leg.level-vrnt_leg.heading_desig_designum-LxAdv-primlaw.level_OR_admindoc.level_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.level_leg.level-vrnt_leg.heading_desig_designum-LxAdv-primlaw.level_OR_admindoc.level_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.level_leg.level-vrnt_leg.heading_edpnum-LxAdv-admindoc.level_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.level_leg.level-vrnt_leg.heading_edpnum-LxAdv-admindoc.level_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.level_leg.level-vrnt_leg.heading_title-LxAdv-primlaw.level_OR_seclaw.level_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.level_leg.level-vrnt_leg.heading_title-LxAdv-primlaw.level_OR_seclaw.level_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.level_leg.level-vrnt_leg.levelinfo_leg.levelstatus-LxAdv-primlaw.level_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.level_leg.level-vrnt_leg.levelinfo_leg.levelstatus-LxAdv-primlaw.level_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.relatedleg-LxAdv-primlaw.subordinatelaw_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.relatedleg-LxAdv-primlaw.subordinatelaw_ref.anchor.xsl"/>
    	<!-\- <topicref href="../../common_newest/Rosetta_refpt-Chof-leg.sectionlist_heading_title-LxAdv-primlaw.level_ref.anchor.dita"/> -\->
    	<xsl:include
    		href="../../modules/nonamespace/Rosetta_refpt-Chof-leg.sectionlist_heading_title-LxAdv-primlaw.level_ref.anchor.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_refpt-Chof-level_heading_edpnum-LxAdv-admindoc.level_ref.anchor.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_refpt-Chof-level_heading_edpnum-LxAdv-admindoc.level_ref.anchor.dita  
     <xsl:message>Rosetta_refpt-Chof-level_heading_edpnum-LxAdv-admindoc.level_ref.anchor.xsl
    		requires manual development!</xsl:message> 
     20170512:  MCJ:  This is a do nothing module as it is unlikely that the instructions can be implemented
        	                  on their own... it is more likely that the handling of level/heading/epdnum to admindoc:level/ref:anchor
        	                  will occur elsewhere. 
     <topicref href="../../common_newest/Rosetta_refpt-Chof-level_heading_title-LxAdv-primlaw.level_OR_seclaw.level_ref.anchor.dita"/> 
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_refpt-Chof-p_text-LxAdv-p_ref.anchor.dita"/> 
    	<xsl:include href="../../modules/nonamespace/Rosetta_refpt-Chof-p_text-LxAdv-p_ref.anchor.xsl"/>
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     <topicref href="../../common_newest/Rosetta_refpt-Chof-p_text_emph-LxAdv-p_ref.anchor.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
     end topichead  refpt  
     start topichead  remotelink  
     <topicref href="../../common_newest/Rosetta_remotelink-LxAdv-ref.crossreference.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_remotelink-LxAdv-ref.crossreference.dita  
    Namespace No namespace
    Match remotelink/@status
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@status"/>
    Template remotelink/@refpt
    Documentation

    Description

     JL: suppressing attributes as templates because they are used in more complex ways below 
    Namespace No namespace
    Match remotelink/@refpt
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@refpt"/>
    Template remotelink/@dpsi
    Namespace No namespace
    Match remotelink/@dpsi
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@dpsi"/>
    Template remotelink/@service
    Namespace No namespace
    Match remotelink/@service
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@service"/>
    Template remotelink/@remotekey1
    Namespace No namespace
    Match remotelink/@remotekey1
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@remotekey1"/>
    Template remotelink[@hrefclass ne 'http' and @service = 'SEARCH']
    Namespace No namespace
    Match remotelink[@hrefclass ne 'http' and @service = 'SEARCH']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink[@hrefclass ne 'http'  and @service = 'SEARCH']">
      <xsl:comment>
        <xsl:copy-of select="."/>
      </xsl:comment>
    </xsl:template>
    Template remotelink[ @service = 'QUERY' ][ not( ancestor::docinfo:assoc-links or parent::glp:note[ not( starts-with( $streamID , 'NZ' ) ) ] ) ]
    Namespace No namespace
    Match remotelink[ @service = 'QUERY' ][ not( ancestor::docinfo:assoc-links or parent::glp:note[ not( starts-with( $streamID , 'NZ' ) ) ] ) ]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="remotelink[ @service = 'QUERY' ][ not( ancestor::docinfo:assoc-links or parent::glp:note[ not( starts-with( $streamID , 'NZ' ) ) ] ) ]">
      <!--  Original Target XPath:  ref:crossreference   -->
      <!-- Suppress remotelink and retain the content -->
      <xsl:apply-templates/>
    </xsl:template>
    Template remotelink[ancestor::docinfo:assoc-links][ @service = 'QUERY' ][ not( $streamID = ( 'CA03', 'CA05' , 'CA06' , 'CA07', 'CA08' ) ) ]
    Namespace No namespace
    Match remotelink[ancestor::docinfo:assoc-links][ @service = 'QUERY' ][ not( $streamID = ( 'CA03', 'CA05' , 'CA06' , 'CA07', 'CA08' ) ) ]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="remotelink[ancestor::docinfo:assoc-links][ @service = 'QUERY' ][ not( $streamID = ( 'CA03', 'CA05' , 'CA06' , 'CA07', 'CA08' ) ) ]"/>
    Template remotelinkDOCID
    Documentation

    Description

    Commeted below line for stop the warning of duplicate rule of glp:note/remotelink
    <xsl:template match="glp:note/remotelink[ @service = 'QUERY' ][ starts-with( $streamID , 'NZ' ) ]"/>
    Namespace No namespace
    Used by
    References
    Import precedence 0
    Source
    <xsl:template name="remotelinkDOCID">
      <!--  Original Target XPath:  ref:crossreference   -->
      <ref:crossreference>
        <!-- following atts and inlineobject template from modules/cttr/HK08k_subseqcases_cttr.annot.xsl -->
        <!-- Sudhanshu Srivastava : Added condition for parent cttr:annot and streamID CA03. -->
        <!-- Awantika: Added inlineobject for AU01 -->
        <xsl:attribute name="crossreferencetype" select="if (((parent::source_cttr:annot or parent::source_cttr:annot or ancestor::citefragment[ancestor::case:references]) and $streamID=('HK08' , 'AU02', 'AU04','UK05','CA03')) or (ancestor::citefragment and inlineobject and $streamID=('NZ09', 'AU17'))or (parent::ci:content and $streamID='AU20') or inlineobject and $streamID='AU01') then 'citatorAlert' else 'seeAlso'"/>
        <xsl:if test="(parent::source_cttr:annot or parent::source_cttr:annot and $streamID=('HK08' , 'AU02', 'AU04','UK05','CA03')) or (ancestor::citefragment and inlineobject and $streamID=('NZ09', 'AU17')) or (parent::ci:content and $streamID='AU20') or inlineobject and $streamID='AU01'">
          <xsl:attribute name="referencedresourcetype" select="'citator'"/>
          <xsl:apply-templates select="inlineobject" mode="citator-ref"/>
        </xsl:if>
        <!-- JD: 20170525: (from UK05) following if test for att 'referencedresourcesentiment' from modules/cttr/UK05_Citator_annotations_cttr.annot-LxAdv-cttr.refs.xsl -->
        <xsl:if test="parent::source_cttr:annot/@signal or parent::source_cttr:annot/@signal and $streamID=('UK05','CA03')">
          <xsl:attribute name="referencedresourcesentiment">
            <xsl:choose>
              <xsl:when test="parent::source_cttr:annot/@signal='citation'">
                <xsl:value-of select="'none'"/>
              </xsl:when>
              <xsl:when test="not(parent::source_cttr:annot/@signal='citation') and parent::source_cttr:annot/@signal">
                <xsl:value-of select="parent::source_cttr:annot/@signal"/>
              </xsl:when>
              <xsl:when test="parent::source_cttr:annot/@signal='citation'">
                <xsl:value-of select="'none'"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:copy-of select="parent::source_cttr:annot/@signal"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="ancestor::citefragment and inlineobject and $streamID=('AU17')">
          <xsl:attribute name="referencedresourcesentiment">
            <xsl:value-of select="lower-case(substring-before(inlineobject/@alttext, ' '))"/>
          </xsl:attribute>
        </xsl:if>
        <!-- JL: Ok to output empty ref:content as ref:content is a required element -->
        <!-- Awantika:24-07-2017: for AU20 added parent::ci:content -->
        <ref:content>
          <xsl:if test="$streamID='AU19_CC'">
            <xsl:attribute name="xml:lang">
              <xsl:value-of select="/CASEDOC/docinfo/docinfo:doc-lang/@lang"/>
            </xsl:attribute>
          </xsl:if>
          <xsl:copy-of select="@xml:lang"/>
          <xsl:apply-templates select="if($streamID='UK12') then @* except(@xml:lang,@refpt) else @* except@xml:lang"/>
          <xsl:if test="parent::source_cttr:annot and $streamID=('HK08' , 'AU02', 'AU04') or parent::ci:content and $streamID='AU20'">
            <xsl:value-of select="if (contains(inlineobject/@alttext, ' - Click for CaseBase entry')) then substring-before(inlineobject/@alttext, ' - Click for CaseBase entry') else inlineobject/@alttext"/>
          </xsl:if>
          <xsl:if test=" $streamID=('NZ09', 'AU17','AU01','NZ11','AU10','HK07')">
            <xsl:value-of select="if (contains(inlineobject/@alttext, ' - Click for CaseBase entry')) then substring-before(inlineobject/@alttext, ' - Click for CaseBase entry') else inlineobject/@alttext"/>
          </xsl:if>
          <!-- Sudhanshu Srivastava: Added if condition for getting ref content for CA03 -->
          <xsl:if test="parent::source_cttr:annot and $streamID=('CA03')">
            <xsl:value-of select="if (contains(inlineobject/@alttext, 'QuickCITE - ')) then substring-after(inlineobject/@alttext, 'QuickCITE - ') else inlineobject/@alttext"/>
          </xsl:if>
          <!-- Awantika:24-07-2017: blobstore mapping was getting created therefore added 'except' for AU20 not to create that instead create the 
    					below ref:locator-->
          <xsl:apply-templates select="node() except inlineobject[parent::remotelink[parent::ci:content][$streamID=('AU20','HK07')]] except inlineobject[$streamID='AU01']"/>
        </ref:content>
        <ref:locator>
          <xsl:for-each select=" if (@refpt) then @refpt else @remotekey2">
            <!-- MDS - 2017-05-12 - Created choose statement to deal with empty @refpt in source resulting in empty @anchoridref in target. -->
            <xsl:choose>
              <xsl:when test="normalize-space(.) = ''"/>
              <xsl:otherwise>
                <!-- JD: 2017-05-26: adding 'if' to prevent @anchoridref being added from markup like this:
    							<remotelink remotekey1="DOC-ID" service="DOC-ID" remotekey2="a1baecf6-dc1f-4bd0-ba0c-a91177f0efe6" dpsi="03W6" status="valid"/>
    							so as to match DT output.
    							-->
                <!-- Sudhanshu Srivastava: addrd StreamID CA03, no need to generate anchoridref attribute. -->
                <!-- Paul: this is often the case.  May want "and @remotekey1="REFPTID" in this somewhere.
    								I'm getting it with DOC-ID in the attribute.  AU08
    								PS2017042700263627135LNIAUCOURTRULES_input_VIC_REG_2008-14810000.xml
    			                    <remotelink dpsi="03AP" remotekey1="DOC-ID" remotekey2="LAWNOW_LEG_LAUNCH_VIC" service="DOC-ID">LawNow Home Page</remotelink>
    							If @remotekey1="REFPTID" then
    								– Create ref:locator/@anchoridref with value from @refpt or @remotekey2, which ever is present (if both are present, use
    								@refpt).-->
                <xsl:if test="not($streamID='UK05' or $streamID='CA03' or $streamID='AU19_CC') and parent::remotelink/@remotekey1='REFPTID'">
                  <xsl:attribute name="anchoridref">
                    <xsl:call-template name="normalizeIdString"/>
                  </xsl:attribute>
                </xsl:if>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each>
          <ref:locator-key>
            <xsl:choose>
              <!-- Awantika: Added choose as it is required to capture URL in ref:key-name while creating ref:crossreference for p/remotelink in AU20 -->
              <xsl:when test="parent::p[parent::note][$streamID='AU20']">
                <ref:key-name name="URL"/>
              </xsl:when>
              <xsl:otherwise>
                <ref:key-name name="DOC-ID"/>
              </xsl:otherwise>
            </xsl:choose>
            <ref:key-value>
              <xsl:attribute name="value">
                <!-- Awantika: Added choose as it is required to capture value of @href while creating ref:crossreference for p/remotelink in AU20 -->
                <xsl:choose>
                  <xsl:when test="@dpsi">
                    <xsl:value-of select="@dpsi"/>
                  </xsl:when>
                  <xsl:when test="parent::p[parent::note][$streamID='AU20']">
                    <xsl:value-of select="@href"/>
                  </xsl:when>
                  <xsl:when test="not(@dpsi) and //docinfo/docinfo:dpsi/@id-string">
                    <xsl:value-of select="//docinfo/docinfo:dpsi/@id-string"/>
                  </xsl:when>
                  <xsl:when test="not(@dpsi) and not(//docinfo/docinfo:dpsi/@id-string)">
                    <xsl:value-of select="$dpsi"/>
                  </xsl:when>
                  <!-- JL if @dpsi isn't present, use DPSI from document or LBU manifest file as in CI above. 
    									Verified with Pacific LBU 2017-11-06 -->
                  <!-- JL : dpsi may be validly missing if the link is invalid -->
                  <xsl:when test="@status=('unval','invalid')">
                    <!-- no @dpsi however status is unvalidated or invalid so don't throw error  -->
                  </xsl:when>
                  <xsl:otherwise>
                    <!--<xsl:value-of select="$dpsi"/>-->
                    <xsl:call-template name="outputErrorMessage">
                      <xsl:with-param name="messageText" as="xs:string" select=" 'remotelink/@dpsi is missing and link cannot be correctly completed' "/>
                      <xsl:with-param name="errorType" as="xs:string" select=" 'ICCE' "/>
                      <xsl:with-param name="errorCode" as="xs:string*" select=" 'TBD' "/>
                      <xsl:with-param name="context" as="xs:string">
                        <xsl:value-of select="base-uri()"/>
                      </xsl:with-param>
                    </xsl:call-template>
                  </xsl:otherwise>
                </xsl:choose>
                <xsl:text>-</xsl:text>
                <xsl:choose>
                  <xsl:when test="$streamID='AU19_CC'">
                    <xsl:value-of select="@refpt"/>
                  </xsl:when>
                  <!-- CSN - 2017/11/06 - Backing this change out from the last SVN Version becuase it may fix AU08 but it breaks links for the other Conversions
    								<xsl:when test=" @remotekey1 = 'DOC-ID' or @remotekey1 = 'DOCID' or @service='DOC-ID'">
    								-->
                  <xsl:when test=" @remotekey1 = 'DOC-ID' or @remotekey1 = 'DOCID'">
                    <xsl:value-of select="if (@remotekey2) then @remotekey2 else @refpt"/>
                  </xsl:when>
                  <xsl:when test=" @remotekey1 = 'REFPTID' or @remotekey1 = 'REFPT' ">
                    <xsl:choose>
                      <xsl:when test="@docidref">
                        <xsl:value-of select="@docidref"/>
                      </xsl:when>
                      <xsl:when test="@status=('unval','invalid')">
                        <!-- no @docidref however status is unvalidated or invalid so don't throw error  -->
                      </xsl:when>
                      <xsl:otherwise>
                        <!-- This should be an error message -->
                        <xsl:text>XXXX</xsl:text>
                        <xsl:call-template name="outputErrorMessage">
                          <xsl:with-param name="messageText" as="xs:string" select=" 'remotelink/@docidref is missing and link cannot be correctly completed' "/>
                          <xsl:with-param name="errorType" as="xs:string" select=" 'ICCE' "/>
                          <xsl:with-param name="errorCode" as="xs:string*" select=" '403' "/>
                          <!--SNB: 2017-10-27 adding the XPATH of problem link to error output instead of previous base:uri() -->
                          <xsl:with-param name="context" as="xs:string">
                            <xsl:call-template name="generateXPath"/>
                          </xsl:with-param>
                          <!--<xsl:with-param name="context" as="xs:string"><xsl:value-of select="base-uri()"/> </xsl:with-param>-->
                        </xsl:call-template>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:when>
                </xsl:choose>
              </xsl:attribute>
            </ref:key-value>
          </ref:locator-key>
        </ref:locator>
      </ref:crossreference>
    </xsl:template>
    Template remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ]
    Documentation

    Description

      multiple immediate sibling remotelinks will get grouped, see further below  
    Namespace No namespace
    Match remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ]"/>
    Template remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ]combineSiblingRemotelinks
    Documentation

    Description

      process immediate sibling remotelink elements one by one  
    Namespace No namespace
    Match remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ]
    Mode combineSiblingRemotelinks
    References
    Template
    Import precedence 0
    Source
    <xsl:template match="remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ]" mode="combineSiblingRemotelinks">
      <!--  output  ref:crossreference for the current remotelink  -->
      <xsl:call-template name="remotelinkDOCID"/>
      <!--  process immediate sibling remotelink elements one by one  -->
      <xsl:apply-templates select="following-sibling::node()[1][self::remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ] ]" mode="combineSiblingRemotelinks"/>
    </xsl:template>
    Template remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ] [parent::li]
    Documentation

    Description

     JD: 2017-10-13: trap remotelink as child of <li>  
    Namespace No namespace
    Match remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ] [parent::li]
    Mode #default
    References
    Template
    Import precedence 0
    Priority 1
    Source
    <xsl:template match="remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ]     [parent::li]" priority="1">
      <p>
        <text>
          <xsl:choose>
            <xsl:when test=" following-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] and not(parent::ci:content)">
              <!--  multiple immediate sibling remotelinks, so group in ref:crossreferencegroup  -->
              <ref:crossreferencegroup>
                <!--  output  ref:crossreference for the current remotelink  -->
                <xsl:call-template name="remotelinkDOCID"/>
                <!--  process immediate sibling remotelink elements one by one  -->
                <xsl:apply-templates select="following-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ]" mode="combineSiblingRemotelinks"/>
              </ref:crossreferencegroup>
            </xsl:when>
            <xsl:otherwise>
              <!--  no grouping needed, so just output  ref:crossreference for the current remotelink  -->
              <xsl:call-template name="remotelinkDOCID"/>
            </xsl:otherwise>
          </xsl:choose>
        </text>
      </p>
    </xsl:template>
    Template remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ]
    Documentation

    Description

     For multiple, immediate, sibling
    			  occurrences without intermediary text, group within a
    				<targetxml>ref:crossreferencegroup</targetxml> parent except for
    				<targetxml>lnci:content</targetxml> and <targetxml>title</targetxml>.<ul>  
      @@@ SBy:  I do not understand what is meant by "except for lnci:content and title" since the examples have those under ref:crossreferencegroup even if there is only one remotelink[ @service = 'DOC-ID' ] sibling !!!  
     JL: seems like lnci:content/ref:crossreferencegroup is not schema valid 
    Namespace No namespace
    Match remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ]
    Mode #default
    References
    Variable
    Template
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ]" priority="2">
      <xsl:choose>
        <!-- BRT 1/30/17 fix issue with missing p element -->
        <xsl:when test="parent::bodytext and $streamID = ('UK15_DS')">
          <p>
            <text>
              <xsl:call-template name="remotelinkDOCID"/>
            </text>
          </p>
        </xsl:when>
        <xsl:when test="$streamID=('AU10','NZ11') and ancestor::level/@leveltype='landingpage'">
          <!--  no grouping needed, it becomes seclaw:subjectmatterreference 
    					which doesn't allow groupings so just output  ref:crossreference for the current remotelink  -->
          <xsl:call-template name="remotelinkDOCID"/>
        </xsl:when>
        <xsl:when test=" following-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] and not(parent::ci:content)">
          <!--  multiple immediate sibling remotelinks, so group in ref:crossreferencegroup  -->
          <ref:crossreferencegroup>
            <!--  output  ref:crossreference for the current remotelink  -->
            <xsl:call-template name="remotelinkDOCID"/>
            <!--  process immediate sibling remotelink elements one by one  -->
            <xsl:apply-templates select="following-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ]" mode="combineSiblingRemotelinks"/>
          </ref:crossreferencegroup>
        </xsl:when>
        <xsl:otherwise>
          <!--  no grouping needed, so just output  ref:crossreference for the current remotelink  -->
          <xsl:call-template name="remotelinkDOCID"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template remotelink[ ( @service = 'URL' or @href ) and ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ][not(parent::ci:content)]remotelink-url-urltext
    Documentation
    Namespace No namespace
    Match remotelink[ ( @service = 'URL' or @href ) and ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ][not(parent::ci:content)]
    Mode #default
    Import precedence 0
    Source
    Template emph[parent::remotelink [( @service = 'URL' or @href ) and ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ][not(parent::ci:content)]]
    Documentation

    Description

     JL emph is invalid as a child of url, so adding this: 
    Namespace No namespace
    Match emph[parent::remotelink [( @service = 'URL' or @href ) and ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ][not(parent::ci:content)]]
    Mode #default
    Import precedence 0
    Priority 35
    Source
    <xsl:template match="emph[parent::remotelink [( @service = 'URL' or @href ) and ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ][not(parent::ci:content)]]" priority="35">
      <xsl:apply-templates/>
    </xsl:template>
    Template remotelink[ ( @service = 'URL' or @href ) and ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ][parent::ci:content]
    Documentation

    Description

    Awantika: If lnci:content/remotelink have the following scenarios:if it's href,url,or www.... then retain the content of remotelink and suppress the element
     Awantika:11-07-2017: Added priority to resolve the conflict on template "remotelink[not(ancestor::docinfo:assoc-links)][ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ]" 
    Namespace No namespace
    Match remotelink[ ( @service = 'URL' or @href ) and ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ][parent::ci:content]
    Mode #default
    Import precedence 0
    Priority 5
    Source
    <xsl:template match="remotelink[ ( @service = 'URL' or @href ) and ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ][parent::ci:content]" priority="5">
      <xsl:apply-templates/>
    </xsl:template>
    Template person/remotelink[$streamID='UK12']
    Documentation

    Description

     2017-11-28 - MDS: person/remotelink output does not allow for ref:lnlink.  url is sufficient for UK12 stream 
    Namespace No namespace
    Match person/remotelink[$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="person/remotelink[$streamID='UK12']" priority="25">
      <url>
        <xsl:attribute name="normval">
          <xsl:value-of select="@hrefclass"/>
          <xsl:text>://</xsl:text>
          <xsl:value-of select="@href"/>
        </xsl:attribute>
        <xsl:apply-templates select="node()"/>
      </url>
    </xsl:template>
    Template remotelink[ ( @service = 'URL' or @href ) and not( ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ) ]remotelink-url
    Documentation
    Namespace No namespace
    Match remotelink[ ( @service = 'URL' or @href ) and not( ( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) ) ) ]
    Mode #default
    Import precedence 0
    Source
    Template remotelink/@href
    Namespace No namespace
    Match remotelink/@href
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@href"/>
    Template remotelink[not(@*)]
    Documentation

    Description

     suppress remotelink and retain its content as text 
    Namespace No namespace
    Match remotelink[not(@*)]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink[not(@*)]">
      <xsl:apply-templates/>
    </xsl:template>
    Template emph[ remotelink and $streamID = 'NZ17-CCD' ]
    Documentation

    Description

     @@@  SBy:  TODO, need to coordinate with Mark S footnote/endote logic:   <p>If <sourcexml>refpt</sourcexml> and <sourcexml>remotelink</sourcexml> occurs as adjacent
    				siblings then refer to the instructions for converting <sourcexml>endnote</sourcexml>.</p>  
    
    				There's another separate module for this... 
    Namespace No namespace
    Match emph[ remotelink and $streamID = 'NZ17-CCD' ]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="emph[ remotelink and $streamID = 'NZ17-CCD' ]">
      <xsl:apply-templates/>
    </xsl:template>
    Template remotelink/@remotekey2
    Namespace No namespace
    Match remotelink/@remotekey2
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@remotekey2"/>
    Template remotelink/@newwindow
    Documentation

    Description

     it doesn't seem like we use this att 
    Namespace No namespace
    Match remotelink/@newwindow
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@newwindow"/>
    Template remotelink/@docidref
    Namespace No namespace
    Match remotelink/@docidref
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@docidref"/>
    Template remotelink[parent::in:entry-text][$streamID='AU16']
    Namespace No namespace
    Match remotelink[parent::in:entry-text][$streamID='AU16']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="remotelink[parent::in:entry-text][$streamID='AU16']" priority="25">
      <index:locator>
        <!-- <in:entry-text>
              <remotelink dpsi="009K" remotekey1="REFPTID" service="DOC-ID" refpt="CTH_BIL_2017-74"
                status="unval">ASIC SUPERVISORY COST RECOVERY LEVY BILL 2017</remotelink>
            </in:entry-text> -->
        <ref:lnlink>
          <xsl:attribute name="service">DOCUMENT</xsl:attribute>
          <ref:marker>
            <xsl:apply-templates select="node()"/>
          </ref:marker>
          <ref:locator>
            <xsl:choose>
              <xsl:when test="not(@refpt)">
                <xsl:attribute name="anchoridref">
                  <xsl:choose>
                    <xsl:when test="string(number(substring(@remotekey2, 1, 1))) = 'NaN'">
                      <xsl:value-of select="@remotekey2"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:value-of select="concat('_', @remotekey2)"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="anchoridref">
                  <xsl:choose>
                    <xsl:when test="string(number(substring(@refpt, 1, 1))) = 'NaN'">
                      <xsl:value-of select="@refpt"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:value-of select="concat('_', @refpt)"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
            <ref:locator-key>
              <ref:key-name name="DOC-ID"/>
              <ref:key-value>
                <xsl:attribute name="value">
                  <xsl:choose>
                    <!-- <in:entry-text>Insurance Premiums Order (January-June) 2014 <remotelink dpsi="005Y"
                  remotekey1="REFPTID" service="DOC-ID" refpt="NSW_REG_2013-622_WA"
                  docidref="NSW_REG_2013-622_SCH11">SCH11CL1SUB1</remotelink></in:entry-text> -->
                    <xsl:when test="@remotekey1 = 'DOC-ID'">
                      <xsl:value-of select="concat(@dpsi, '-')"/>
                      <xsl:choose>
                        <xsl:when test="not(@remotekey2)">
                          <xsl:value-of select="@refpt"/>
                        </xsl:when>
                        <xsl:otherwise>
                          <xsl:value-of select="@remotekey2"/>
                        </xsl:otherwise>
                      </xsl:choose>
                    </xsl:when>
                    <xsl:when test="@remotekey1 = 'REFPTID'">
                      <xsl:value-of select="concat(@dpsi, '-')"/>
                      <xsl:choose>
                        <xsl:when test="@docidref">
                          <xsl:value-of select="@docidref"/>
                        </xsl:when>
                        <xsl:otherwise>
                          <xsl:text>XXXX</xsl:text>
                        </xsl:otherwise>
                      </xsl:choose>
                    </xsl:when>
                  </xsl:choose>
                </xsl:attribute>
              </ref:key-value>
            </ref:locator-key>
          </ref:locator>
        </ref:lnlink>
      </index:locator>
    </xsl:template>
    Template remotelink[ ( @service = 'URL' or @href ) and not(( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) )) ][$streamID='UK11DA']
    Documentation

    Description

    Vikas Rohilla : Template to match the remotelink
    Namespace No namespace
    Match remotelink[ ( @service = 'URL' or @href ) and not(( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) )) ][$streamID='UK11DA']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 20
    Source
    <xsl:template match="remotelink[ ( @service = 'URL' or @href ) and not(( contains( . , 'www' ) or contains( . , 'http' ) or contains( . , 'mailto' ) or contains( . , 'ftp' ) )) ][$streamID='UK11DA']" priority="20">
      <url>
        <xsl:attribute name="normval">
          <xsl:if test=" @hrefclass and not( contains( @href , @hrefclass ) ) ">
            <xsl:value-of select="@hrefclass"/>
            <xsl:text>://</xsl:text>
          </xsl:if>
          <xsl:value-of select="normalize-space( @href )"/>
        </xsl:attribute>
        <xsl:apply-templates/>
      </url>
    </xsl:template>
    Template remotelink/@alttext
    Namespace No namespace
    Match remotelink/@alttext
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="remotelink/@alttext"/>
    Template remotelink[(ancestor::docinfo:assoc-links)| (ancestor::docinfo:assoc-links-grp)] [parent::text] [ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ] [$streamID='UK15' or $streamID='UK12' or $streamID='UK14']
    Documentation
    Namespace No namespace
    Match remotelink[(ancestor::docinfo:assoc-links)| (ancestor::docinfo:assoc-links-grp)] [parent::text] [ @service = 'DOC-ID' ][ not( preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ] ] ) ] [$streamID='UK15' or $streamID='UK12' or $streamID='UK14']
    Mode #default
    References
    Import precedence 0
    Priority 40
    Source
    Template remotelink[(ancestor::docinfo:assoc-links)| (ancestor::docinfo:assoc-links-grp)][parent::text][preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ]]][$streamID='UK15']
    Namespace No namespace
    Match remotelink[(ancestor::docinfo:assoc-links)| (ancestor::docinfo:assoc-links-grp)][parent::text][preceding-sibling::node()[1][self::remotelink[ @service = 'DOC-ID' ]]][$streamID='UK15']
    Mode #default
    References
    Import precedence 0
    Priority 2
    Source
    Template remotelink[@refpt=''][$streamID='UK12']
    Documentation

    Description

     Vikas Rohilla : included for the UK12	
    Namespace No namespace
    Match remotelink[@refpt=''][$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="remotelink[@refpt=''][$streamID='UK12']" priority="25">
      <ref:lnlink>
        <ref:marker>
          <xsl:apply-templates select="node()"/>
        </ref:marker>
        <ref:locator>
          <xsl:apply-templates select="@refpt"/>
        </ref:locator>
      </ref:lnlink>
    </xsl:template>
    Template remotelink/@refpt[$streamID='UK12']
    Namespace No namespace
    Match remotelink/@refpt[$streamID='UK12']
    Mode #default
    References
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="remotelink/@refpt[$streamID='UK12']" priority="25">
      <xsl:choose>
        <xsl:when test="normalize-space(.)!=''">
          <xsl:attribute name="anchoridref">
            <xsl:call-template name="normalizeIdString"/>
          </xsl:attribute>
        </xsl:when>
        <xsl:otherwise>
          <xsl:comment>Mandatory element according to the CI</xsl:comment>
          <xsl:call-template name="outputErrorMessage">
            <xsl:with-param name="messageText" as="xs:string" select=" 'remotelink/@refpt is missing and link cannot be correctly completed' "/>
            <xsl:with-param name="errorType" as="xs:string" select=" 'ICCE' "/>
            <xsl:with-param name="errorCode" as="xs:string*" select=" 'TBD' "/>
            <xsl:with-param name="context" as="xs:string">
              <xsl:value-of select="base-uri()"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template remotelink[@refpt='dummy' and @status='unval'][$streamID='HK07']
    Documentation

    Description

    SS 28-11-2017: Added handling of remotelink/@refpt='dummy' value comes in HK07.
    Namespace No namespace
    Match remotelink[@refpt='dummy' and @status='unval'][$streamID='HK07']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="remotelink[@refpt='dummy' and @status='unval'][$streamID='HK07']">
      <xsl:apply-templates/>
    </xsl:template>
    Template remotelink[key('idTypeValue', @refpt)[self::refpt]][not(ancestor::ci:content)][not(parent::source_cttr:annot and $streamID=('HK08' , 'AU02', 'AU04','UK05','CA03'))][not(parent::docinfo:assoc-links-grp and $streamID='AU04')]
    Documentation
    Namespace No namespace
    Match remotelink[key('idTypeValue', @refpt)[self::refpt]][not(ancestor::ci:content)][not(parent::source_cttr:annot and $streamID=('HK08' , 'AU02', 'AU04','UK05','CA03'))][not(parent::docinfo:assoc-links-grp and $streamID='AU04')]
    Mode #default
    References
    Import precedence 0
    Priority 25
    Source
    Template remotelink/@refptintradoc
    Namespace No namespace
    Match remotelink/@refpt
    Mode intradoc
    References
    Import precedence 0
    Source
    <xsl:template match="remotelink/@refpt" mode="intradoc">
      <xsl:call-template name="normalizeIdString"/>
    </xsl:template>
    Template sigblock
    Documentation

    Description

    Instructions [common element]

    sigblock becomes sigblock with optional attribute @align and values are tokenized (left | right | center | justify).

    Source XML

     <sigblock> <p> <text> <person> <name.text>D I CASSIDY QC</name.text> </person> </text> </p> </sigblock> 

    Target XML

     <sigblock> <p> <text> <person:person> <person:name.text>D I CASSIDY QC</person:name.text> </person:person> </text> </p> </sigblock>
    				

    Description

     end topichead  remotelink  
     rosetta element: sigblock 
     <topicref href="../../common_newest/Rosetta_sigblock-LxAdv-sigblock.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_sigblock-LxAdv-sigblock.dita  
     Vikas Rohilla : Template to mach the sigblock and copy the element
    Namespace No namespace
    Match sigblock
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sigblock">
      <sigblock>
        <xsl:apply-templates select="@* | node()"/>
      </sigblock>
    </xsl:template>
    Template sigblock[parent::leg:endmatter | parent::leg:levelbody]
    Documentation

    Description

     CSN - 2017/09/29 - added parent::leg:levelbody for UK07 GDS test case 
    Namespace No namespace
    Match sigblock[parent::leg:endmatter | parent::leg:levelbody]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sigblock[parent::leg:endmatter | parent::leg:levelbody]">
      <primlaw:bodytext>
        <sigblock>
          <xsl:apply-templates select="@* | node()"/>
        </sigblock>
      </primlaw:bodytext>
    </xsl:template>
    Template sigblock[ancestor::form]
    Namespace No namespace
    Match sigblock[ancestor::form]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sigblock[ancestor::form]">
      <form:sigblock>
        <xsl:apply-templates select="@* | node()"/>
      </form:sigblock>
    </xsl:template>
    Template sigblock/p[text][ancestor::form]
    Namespace No namespace
    Match sigblock/p[text][ancestor::form]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sigblock/p[text][ancestor::form]"/>
    Template sigblock/p/text[ancestor::form]
    Namespace No namespace
    Match sigblock/p/text[ancestor::form]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sigblock/p/text[ancestor::form]">
      <form:line>
        <xsl:apply-templates select="node()"/>
      </form:line>
    </xsl:template>
    Template sigblock/p/table
    Namespace No namespace
    Match sigblock/p/table
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sigblock/p/table">
      <table>
        <xsl:apply-templates select="@* | node()"/>
      </table>
    </xsl:template>
    Template strike
    Documentation

    Description

    Instructions [common element]

    strike becomes strike. The optional attribute @typestyle becomes @typestyle.

    Source XML 1

    
    <emph typestyle="ro">
        <strike typestyle="lineout">s&#xA0;</strike>
    </emph>>
    
    	

    Target XML

    
    <emph typestyle="ro">
        <strike typestyle="lineout">s&#xA0;</strike>
    </emph>
    
    	

    Source XML 2

    
    <strike>Gilles Prud'homme</strike>
    
    	

    Target XML

    
    <strike typestyle="lineout">Gilles Prud'homme</strike>
    
    	

    Description

     rosetta element: strike 
     <topicref href="../../common_newest/Rosetta_strike-LxAdv-strike.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_strike-LxAdv-strike.dita  
     Vikas Rohilla : Updated the template hegher the priorty 
     JD: removed priority; commented competing template in /modules/nonamespace/Rosetta_text-LxAdv-text.xsl; 
    	this should be the default for all <strike> handling. 
    Namespace No namespace
    Match strike
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="strike">
      <strike>
        <xsl:apply-templates select="@* | node()"/>
      </strike>
    </xsl:template>
    Template strike/@typestyle
    Documentation

    Description

     Vikas Rohilla : creted template for the @typestyle
    Namespace No namespace
    Match strike/@typestyle
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="strike/@typestyle">
      <xsl:attribute name="typestyle">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Template sub
    Documentation

    Description

    Instructions [common element]

    sub becomes sub.

    Source XML

    
    <emph typestyle="it">
      <sub>*</sub>
    </emph>
    
    	

    Target XML

    
    <emph typestyle="it">
      <sub>*</sub>
    </emph>
    
    	

    Description

     rosetta element: sub 
     <topicref href="../../common_newest/Rosetta_sub-LxAdv-sub.dita"/> 
    Namespace No namespace
    Match sub
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sub">
      <sub>
        <xsl:apply-templates select="@* | node()"/>
      </sub>
    </xsl:template>
    Template subtitle
    Documentation

    Description

    Instructions [common element]

    subtitle becomes subtitle

    Source XML

    
    <heading>
    	<subtitle>Applications for leave to appeal against sentence not heard by a single judge of appeal</subtitle>
    </heading>
    
    	

    Target XML

    
    <heading>
    	<subtitle>Applications for leave to appeal against sentence not heard by a single judge of appeal</subtitle>
    </heading>
    
    	

    Description

     rosetta element: subtitle 
     <topicref href="../../common_newest/Rosetta_subtitle-LxAdv-subtitle.dita"/> 
    Namespace No namespace
    Match subtitle
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="subtitle">
      <!--  Original Target XPath:  subtitle   -->
      <subtitle>
        <xsl:apply-templates select="@* | node() except refpt"/>
      </subtitle>
    </xsl:template>
    Template sup
    Documentation

    Description

    Instructions [common element]

    sup becomes sup

    Source XML

    
    <emph typestyle="it">
      <sup>*</sup>
    </emph>
    
    	

    Target XML

    
    <emph typestyle="it">
      <sup>*</sup>
    </emph>
    
    	

    Description

     rosetta element: sup 
     <topicref href="../../common_newest/Rosetta_sup-LxAdv-sup.dita"/> 
    Namespace No namespace
    Match sup
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="sup">
      <sup>
        <xsl:apply-templates select="@* | node()"/>
      </sup>
    </xsl:template>
    Template table[descendant::entry/descendant::page]
    Documentation

    Description

    Instructions [common element]

    Contains the titling content for a table, and titled groups that contain rows of cells ("entries"). Table now allows an optional heading element, which contains the titling content as well. The titling elements directly within table - title and subtitle - are deprecated in favor of using these elements inside the heading.

    • table becomes table comes with @frame becomes @frame which has tokenized values as (top | bottom | topbot | all | sides | none) and required child element is described below:
      • tgroup becomes tgroup with attributes @cols becomes @cols is the required attribute. @colsep becomes @colsep @rowsep becomes @rowsep and child element includes:
        • colspec becomes colspec and attributes are converted as follows:
          • @align becomes @align
          • @char becomes @char
          • @charoff becomes @charoff
          • @colname becomes @colname
          • @colnum becomes @colnum
          • @colsep becomes @colsep
          • @colwidth becomes @colwidth
          • @id may be dropped or may require special handling. It may become @ref:anchor and if so is moved to the parent or higher ancestor element. This will be specified in the the particular CI as it will be done on a stream by stream basis and will depend on the particular XPath of the table element. In the absence of specific instructions elsewhere in the CI, @id is dropped.
          • @rowsep becomes @rowsep
          • @searchtype is dropped
          • @xml:lang becomes @xml:lang

          Note:

          CALS table markup allows for units to be embedded in the column width. Lexis Advance only recognizes an integer in pixels and proportional, identified by a number ending with "*".

          If a non-Lexis Advance format is discovered a warning should be raised.

          If the LBU requires a conversion of CALS units to LA accepted units, some of the conversions are detailed below.

          If colspec@colwidth ends in “in” (inch) them remove “in” and multiply the value by 96 to convert to pixel. Only keep the integer portion of the result. These are not valid: 0.1, 12.86. These are valid: 12, 185

          cm; follow the inches example above but use a conversion value of 37.7952755904

          mm; follow the inches example above but use a conversion value of 3.77952755904

          pt; follow the inches example above but use a conversion value of 1.0

        The following instructions apply to all table markup (table element and its decendents) with @morerows, @colsep, and @rowsep attributes:

        • Remove any instances of @morerows=0
        • If ALL occurrences of @colsep in one table have a value of zero, remove them all from that table.
        • If ALL occurrences of @rowsep in one table have a value of zero, remove them all from that table.

        Note: Although these instructions apply to all content streams, only the UK content streams and AU18 are known to have these issues.

        • thead becomes thead below is the required child element:
          • row becomes row below is the required child element:
            • entry becomes entry and comes with @nameend becomes @nameend @namest becomes @namest @align becomes @align with tokenized values as (left | right | center | justify | char)
        • tbody becomes tbody and child element includes:
          • row becomes row and child element includes:
            • entry becomes entry and comes with @nameend becomes @nameend @namest becomes @namest @char becomes @char @align becomes @align with tokenized values as (left | right | center | justify | char)

    Note: Multiple tgroup are retained for conversion.

    Source XML

     <table frame="none"> <tgroup cols="3" colsep="0" rowsep="0">
    					<colspec colname="col1" colnum="1" colwidth="5*"/> <colspec
    					colname="col2" colnum="2" colwidth="83*"/> <colspec align="left"
    					colname="col3" colnum="3" colwidth="12*"/> <thead> <row>
    					<entry align="center" nameend="col3" namest="col1"><emph
    					typestyle="bf">Table of contents</emph></entry> </row>
    					<row> <entry/><entry/> <entry align="right"
    					colname="col3"><emph typestyle="bf">Para no</emph></entry>
    					</row> </thead> <tbody> <row> <entry align="left"
    					nameend="col2" namest="col1">Introduction</entry> <entry
    					align="right" colname="col3">[1]</entry> </row> <row>
    					<entry align="left" nameend="col2" namest="col1">Mental health legislation
    					concerning informal patients</entry> <entry align="right"
    					colname="col3">[6]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">Procedural background</entry>
    					<entry align="right" colname="col3">[15]</entry> </row>
    					<row> <entry align="left" nameend="col2" namest="col1">Applicable
    					statutory provisions</entry> <entry align="right"
    					colname="col3">[22]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">The English position</entry>
    					<entry align="right" colname="col3">[33]</entry> </row>
    					<row> <entry align="left" nameend="col2" namest="col1">Submissions
    					of parties</entry> <entry align="right"
    					colname="col3">[39]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">Protective provisions</entry>
    					<entry align="right" colname="col3">[43]</entry> </row>
    					<row> <entry align="left" nameend="col2" namest="col1">The 1961 Act:
    					Crown authority to treat informal patients</entry> <entry align="right"
    					colname="col3">[45]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">Leave requirements</entry>
    					<entry align="right" colname="col3">[50]</entry> </row>
    					<row> <entry align="left" nameend="col2" namest="col1">The 1969
    					Act</entry> <entry align="right" colname="col3"> </entry>
    					</row> <row> <entry/> <entry align="left"
    					colname="col2">(a) Crown authority to treat informal patients</entry>
    					<entry align="right" colname="col3">[54]</entry> </row>
    					<row> <entry/> <entry align="left" colname="col2">(b)
    					Authority of hospital boards to treat informal patients</entry> <entry
    					align="right" colname="col3">[56]</entry> </row> <row>
    					<entry align="left" nameend="col2" namest="col1">Conclusion</entry>
    					<entry align="right" colname="col3">[75]</entry> </row>
    					</tbody> </tgroup> </table> 

    Target XML

     <table frame="none"> <tgroup cols="3"> <colspec
    					colname="col1" colnum="1" colwidth="5*"/> <colspec colname="col2"
    					colnum="2" colwidth="83*"/> <colspec align="left" colname="col3"
    					colnum="3" colwidth="12*"/> <thead> <row> <entry
    					align="center" nameend="col3" namest="col1"><emph typestyle="bf">Table
    					of contents</emph></entry> </row> <row>
    					<entry/><entry/> <entry align="right" colname="col3"><emph
    					typestyle="bf">Para no</emph></entry> </row> </thead>
    					<tbody> <row> <entry align="left" nameend="col2"
    					namest="col1">Introduction</entry> <entry align="right"
    					colname="col3">[1]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">Mental health legislation
    					concerning informal patients</entry> <entry align="right"
    					colname="col3">[6]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">Procedural background</entry>
    					<entry align="right" colname="col3">[15]</entry> </row>
    					<row> <entry align="left" nameend="col2" namest="col1">Applicable
    					statutory provisions</entry> <entry align="right"
    					colname="col3">[22]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">The English position</entry>
    					<entry align="right" colname="col3">[33]</entry> </row>
    					<row> <entry align="left" nameend="col2" namest="col1">Submissions
    					of parties</entry> <entry align="right"
    					colname="col3">[39]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">Protective provisions</entry>
    					<entry align="right" colname="col3">[43]</entry> </row>
    					<row> <entry align="left" nameend="col2" namest="col1">The 1961 Act:
    					Crown authority to treat informal patients</entry> <entry align="right"
    					colname="col3">[45]</entry> </row> <row> <entry
    					align="left" nameend="col2" namest="col1">Leave requirements</entry>
    					<entry align="right" colname="col3">[50]</entry> </row>
    					<row> <entry align="left" nameend="col2" namest="col1">The 1969
    					Act</entry> <entry align="right" colname="col3"> </entry>
    					</row> <row> <entry/> <entry align="left"
    					colname="col2">(a) Crown authority to treat informal patients</entry>
    					<entry align="right" colname="col3">[54]</entry> </row>
    					<row> <entry/> <entry align="left" colname="col2">(b)
    					Authority of hospital boards to treat informal patients</entry> <entry
    					align="right" colname="col3">[56]</entry> </row> <row>
    					<entry align="left" nameend="col2" namest="col1">Conclusion</entry>
    					<entry align="right" colname="col3">[75]</entry> </row>
    					</tbody> </tgroup> </table> 

    Description

     rosetta element: table 
     start topichead  table  
     <topicref href="../../common_newest/Rosetta_table-LxAdv-table.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_table-LxAdv-table.dita  
      @SBy:  this is from QC XSLT.  Should it appear here?  
     BRT: process table with page elements (break table in row before each row//page, create ref:page, create another table starting from row//page 
    Namespace No namespace
    Match table[descendant::entry/descendant::page]
    Mode #default
    Import precedence 0
    Priority 15
    Source
    <xsl:template match="table[descendant::entry/descendant::page]" priority="15">
      <!-- BRT create a separate table before the start of a row that contains entry/descendant::page -->
      <xsl:for-each-group select=".//row" group-starting-with="row[entry/descendant::page]">
        <!-- BRT: If there is a ref:page in the current-group(), create the ref:page first -->
        <xsl:if test="current-group()//page">
          <xsl:element name="ref:page">
            <xsl:attribute name="num">
              <xsl:value-of select="translate(current-group()//page/@count, ',', '')"/>
            </xsl:attribute>
            <xsl:if test="current-group()//page/@reporter">
              <xsl:attribute name="page-scheme">
                <xsl:value-of select="translate(current-group()//page/@reporter, ' ', '_')"/>
              </xsl:attribute>
            </xsl:if>
            <xsl:if test="current-group()//page/@subdoc">
              <xsl:attribute name="includeintoc">
                <xsl:value-of select="current-group()//page/@subdoc"/>
              </xsl:attribute>
            </xsl:if>
            <xsl:attribute name="page-scheme-type">
              <xsl:text>reporter-abbreviation</xsl:text>
            </xsl:attribute>
          </xsl:element>
        </xsl:if>
        <!-- BRT create separate table for each group -->
        <xsl:element name="table" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
          <!-- BRT: Convert table, tgroup, and colspec  -->
          <xsl:copy-of select="ancestor::table/(@* except @id)"/>
          <xsl:if test="ancestor::table/@id">
            <xsl:variable name="count" select="position()"/>
            <xsl:for-each select="ancestor::table/@id">
              <xsl:attribute name="xml:id">
                <xsl:value-of select="concat(ancestor::table/@id, '_', $count)"/>
              </xsl:attribute>
            </xsl:for-each>
          </xsl:if>
          <xsl:element name="tgroup" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
            <xsl:copy-of select="ancestor::table[1]/tgroup/@*"/>
            <xsl:for-each select="ancestor::table[1]//colspec">
              <xsl:element name="colspec" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
                <xsl:copy-of select="@*"/>
                <xsl:apply-templates/>
              </xsl:element>
            </xsl:for-each>
            <xsl:for-each select="ancestor::table[1]//thead">
              <xsl:element name="thead" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
                <xsl:copy-of select="@*"/>
                <xsl:apply-templates/>
              </xsl:element>
            </xsl:for-each>
            <xsl:element name="tbody" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
              <xsl:copy-of select="ancestor::table[1]//tbody/@*"/>
              <!-- apply all the rows of the current group to the current table -->
              <xsl:apply-templates select="current-group()"/>
            </xsl:element>
          </xsl:element>
        </xsl:element>
      </xsl:for-each-group>
    </xsl:template>
    Template tabletable
    Documentation

    Description

      @SBy:  modified from QC XSLT  
     2017-10-17 - MDS: Added choose statment due to webstar 7025682.   
     2017-11-16 - CSN: Added UK03|case:dicisionsummary to existing 'when'.  webstar 7050317.   
    Namespace No namespace
    Match table
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="table" name="table">
      <xsl:choose>
        <xsl:when test="parent::entry or ((parent::case:decisionsummary or parent::case:typeofcase) and $streamID='UK03')">
          <p>
            <table>
              <xsl:copy-of select="@frame | @pgwide"/>
              <!--  @SBy:  only @frame is in DITA  -->
              <!--  @SBy:  note @colsep | @rowsep addressed specifically in other template rules below  -->
              <xsl:apply-templates select="@* except (@frame, @pgwide)"/>
              <xsl:apply-templates/>
            </table>
          </p>
        </xsl:when>
        <xsl:otherwise>
          <table>
            <xsl:copy-of select="@frame"/>
            <!-- BRT 11/16/17 added special handling for @pgwide in UK content. If value is '0', output is '0', otherwise, the output is '1' -->
            <xsl:choose>
              <xsl:when test="$streamID = ('UK01', 'UK02', 'UK05', 'UK08CA','UK08OR', 'UK09', 'UK10', 'UK15', 'UK17', 'UK18','UK20','UK22LF')">
                <xsl:if test="@pgwide">
                  <xsl:attribute name="pgwide">
                    <xsl:choose>
                      <xsl:when test="@pgwide='0'">
                        <xsl:value-of select="'0'"/>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:value-of select="'1'"/>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:attribute>
                </xsl:if>
              </xsl:when>
              <xsl:otherwise>
                <xsl:copy-of select="@pgwide"/>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:copy-of select="@frame"/>
            <!--  @SBy:  only @frame is in DITA  -->
            <!--  @SBy:  note @colsep | @rowsep addressed specifically in other template rules below  -->
            <xsl:apply-templates select="@* except (@frame, @pgwide)"/>
            <xsl:apply-templates/>
          </table>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template tgroup
    Namespace No namespace
    Match tgroup
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="tgroup">
      <tgroup>
        <xsl:copy-of select="@cols"/>
        <!--  @SBy:  note @colsep | @rowsep addressed specifically in other template rules below  -->
        <xsl:apply-templates select="@* except @cols"/>
        <xsl:apply-templates/>
      </tgroup>
    </xsl:template>
    Template tgroup/@align
    Namespace No namespace
    Match tgroup/@align
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="tgroup/@align">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template colspec
    Namespace No namespace
    Match colspec
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="colspec">
      <colspec>
        <xsl:copy-of select="@align | @char | @charoff | @colname | @colnum | @xml:lang"/>
        <!--  @SBy:  note @colsep | @rowsep addressed specifically in other template rules below  -->
        <xsl:apply-templates select="@* except (@align, @char, @charoff, @colname, @colnum, @xml:lang)"/>
        <xsl:apply-templates/>
        <!--  ***NOTE  -  see DITA regarding conversions of @colwidth values; does the DT code do any of that?  ***  -->
      </colspec>
    </xsl:template>
    Template colspec/@colwidth
    Namespace No namespace
    Match colspec/@colwidth
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="colspec/@colwidth">
      <xsl:attribute name="colwidth">
        <!--<xsl:value-of select="."/>-->
        <xsl:analyze-string select="." regex="([0-9]+)([*]|[a-z]+)">
          <xsl:matching-substring>
            <xsl:choose>
              <xsl:when test="regex-group(2) = 'in'">
                <xsl:variable name="var1">
                  <xsl:value-of select="number(regex-group(1)) * 96"/>
                </xsl:variable>
                <xsl:value-of select="$var1"/>
                <xsl:value-of select="concat($var1, '*')"/>
              </xsl:when>
              <xsl:when test="regex-group(2) = 'cm'">
                <xsl:variable name="var1">
                  <xsl:value-of select="number(regex-group(1)) * 37.7952755904"/>
                </xsl:variable>
                <xsl:value-of select="concat(substring-before($var1, '.'), '*')"/>
              </xsl:when>
              <xsl:when test="regex-group(2) = 'mm'">
                <xsl:variable name="var1">
                  <xsl:value-of select="number(regex-group(1)) * 3.77952755904"/>
                </xsl:variable>
                <xsl:value-of select="concat(substring-before($var1, '.'), '*')"/>
              </xsl:when>
              <xsl:when test="regex-group(2) = 'pt'">
                <xsl:variable name="var1">
                  <xsl:value-of select="number(regex-group(1)) * 1"/>
                </xsl:variable>
                <xsl:value-of select="concat($var1, '*')"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="concat(regex-group(1), '*')"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:matching-substring>
        </xsl:analyze-string>
      </xsl:attribute>
    </xsl:template>
    Template colspec[$streamID=('USLPA')]/@colwidth
    Documentation

    Description

     SNB 2017-10-17 creating a new template that I think probably oght to be the template for all rosetta conversions for colwidth... 
    		the above template creates flat out WRONG rarget markup when here's a decimal ( colwidth="78.50pt" resulted in 
    		  colwidth="50*", and  colwidth="80.00pt" resulted in  colwidth="0*"), and catching an empty column width seems wise in general. 
    		  For LPA, we need to catch numbers with no * or units, which none of these templates do. The ones below for NZ111 and AU10 catch 
    		  decimal numbers well, but not the case of no units or *. 
    Namespace No namespace
    Match colspec[$streamID=('USLPA')]/@colwidth
    Mode #default
    References
    Import precedence 0
    Priority 3
    Source
    <xsl:template match="colspec[$streamID=('USLPA')]/@colwidth" priority="3">
      <xsl:attribute name="colwidth">
        <xsl:choose>
          <!-- empty colwidth -->
          <xsl:when test="normalize-space(.)=''">
            <!-- converts empty colwidth to "*" -->
            <xsl:value-of select="'*'"/>
          </xsl:when>
          <!-- only a number, no decimal, no units, add * at end -->
          <xsl:when test="(not(matches(.,'[a-z\.*]+','i')))">
            <xsl:value-of select="concat(., '*')"/>
          </xsl:when>
          <!-- only a DECIMAL number, no units, strip decimal and following numbers and add * at end -->
          <xsl:when test="(not(matches(.,'[a-z*]+','i')))">
            <xsl:analyze-string select="." regex="([0-9]+)(\.+)([0-9]+)">
              <xsl:matching-substring>
                <!--Dont need to choose; just use regex-group(1) and throw rest away-->
                <xsl:value-of select="concat(regex-group(1), '*')"/>
              </xsl:matching-substring>
              <xsl:non-matching-substring/>
            </xsl:analyze-string>
          </xsl:when>
          <!-- number with decimal, with units, strip decimal, convert to specified unit, and add * at end -->
          <xsl:when test="(matches(.,'[0-9]+[\.][0-9]*([*]|[a-z]+)','i'))">
            <xsl:analyze-string select="." regex="([0-9\.]+)([*]|[a-zA-Z]+)">
              <xsl:matching-substring>
                <xsl:variable name="wholenumber" select="number(substring-before(regex-group(1),'.'))"/>
                <xsl:choose>
                  <xsl:when test="lower-case(regex-group(2)) = 'in'">
                    <xsl:variable name="var1">
                      <xsl:value-of select="number($wholenumber) * 96"/>
                    </xsl:variable>
                    <xsl:value-of select="concat($var1, '*')"/>
                  </xsl:when>
                  <xsl:when test="lower-case(regex-group(2)) = 'cm'">
                    <xsl:variable name="var1">
                      <xsl:value-of select="number($wholenumber) * 37.7952755904"/>
                    </xsl:variable>
                    <xsl:value-of select="concat(substring-before($var1, '.'), '*')"/>
                  </xsl:when>
                  <xsl:when test="lower-case(regex-group(2)) = 'mm'">
                    <xsl:variable name="var1">
                      <xsl:value-of select="number($wholenumber) * 3.77952755904"/>
                    </xsl:variable>
                    <xsl:value-of select="concat(substring-before($var1, '.'), '*')"/>
                  </xsl:when>
                  <xsl:when test="lower-case(regex-group(2)) = 'pt'">
                    <xsl:variable name="var1">
                      <xsl:value-of select="number($wholenumber) * 1"/>
                    </xsl:variable>
                    <xsl:value-of select="concat($var1, '*')"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="concat($wholenumber, '*')"/>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:matching-substring>
            </xsl:analyze-string>
          </xsl:when>
          <!-- number without decimal, with units, convert to specified unit, and add * at end -->
          <xsl:when test="(matches(.,'[0-9]+([*]|[a-z]+)','i'))">
            <xsl:analyze-string select="." regex="([0-9]+)([*]|[a-zA-Z]+)">
              <xsl:matching-substring>
                <xsl:choose>
                  <xsl:when test="lower-case(regex-group(2)) = 'in'">
                    <xsl:variable name="var1">
                      <xsl:value-of select="number(regex-group(1)) * 96"/>
                    </xsl:variable>
                    <xsl:value-of select="concat($var1, '*')"/>
                  </xsl:when>
                  <xsl:when test="lower-case(regex-group(2)) = 'cm'">
                    <xsl:variable name="var1">
                      <xsl:value-of select="number(regex-group(1)) * 37.7952755904"/>
                    </xsl:variable>
                    <xsl:value-of select="concat(substring-before($var1, '.'), '*')"/>
                  </xsl:when>
                  <xsl:when test="lower-case(regex-group(2))= 'mm'">
                    <xsl:variable name="var1">
                      <xsl:value-of select="number(regex-group(1)) * 3.77952755904"/>
                    </xsl:variable>
                    <xsl:value-of select="concat(substring-before($var1, '.'), '*')"/>
                  </xsl:when>
                  <xsl:when test="lower-case(regex-group(2)) = 'pt'">
                    <xsl:variable name="var1">
                      <xsl:value-of select="number(regex-group(1)) * 1"/>
                    </xsl:variable>
                    <xsl:value-of select="concat($var1, '*')"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="concat(regex-group(1), '*')"/>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:matching-substring>
            </xsl:analyze-string>
          </xsl:when>
          <!-- unsupported format -->
          <xsl:otherwise>
            <!-- output whatever was in colwidth -->
            <xsl:value-of select="."/>
            <!-- generate warning -->
            <xsl:call-template name="outputErrorMessage">
              <xsl:with-param name="messageText" as="xs:string" select="concat('ERROR: unexpected format for @colwidth: ',.) "/>
              <xsl:with-param name="errorType" as="xs:string" select=" 'ROCKET' "/>
              <xsl:with-param name="errorCode" as="xs:string*" select=" '405' "/>
              <xsl:with-param name="context" as="xs:string">
                <xsl:call-template name="generateXPath"/>
              </xsl:with-param>
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:attribute>
    </xsl:template>
    Template colspec[$streamID=('NZ11','AU10')]/@colwidth[.='']
    Namespace No namespace
    Match colspec[$streamID=('NZ11','AU10')]/@colwidth[.='']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="colspec[$streamID=('NZ11','AU10')]/@colwidth[.='']" priority="2">
      <!-- converts empty colwidth to "*" -->
      <xsl:attribute name="colwidth">*</xsl:attribute>
    </xsl:template>
    Template colspec[$streamID=('NZ11','AU10')]/@colwidth[contains(.,'.')]
    Namespace No namespace
    Match colspec[$streamID=('NZ11','AU10')]/@colwidth[contains(.,'.')]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="colspec[$streamID=('NZ11','AU10')]/@colwidth[contains(.,'.')]" priority="2">
      <!-- for use when there is a decimal value in @colwidth.  it truncates the whole number and passes it through -->
      <xsl:attribute name="colwidth">
        <!--<xsl:value-of select="."/>-->
        <xsl:analyze-string select="." regex="([0-9\.]+)([*]|[a-z]+)">
          <xsl:matching-substring>
            <xsl:variable name="wholenumber" select="number(substring-before(regex-group(1),'.'))"/>
            <xsl:choose>
              <xsl:when test="regex-group(2) = 'in'">
                <xsl:variable name="var1">
                  <xsl:value-of select="number($wholenumber) * 96"/>
                </xsl:variable>
                <xsl:value-of select="$var1"/>
                <xsl:value-of select="concat($var1, '*')"/>
              </xsl:when>
              <xsl:when test="regex-group(2) = 'cm'">
                <xsl:variable name="var1">
                  <xsl:value-of select="number($wholenumber) * 37.7952755904"/>
                </xsl:variable>
                <xsl:value-of select="concat(substring-before($var1, '.'), '*')"/>
              </xsl:when>
              <xsl:when test="regex-group(2) = 'mm'">
                <xsl:variable name="var1">
                  <xsl:value-of select="number($wholenumber) * 3.77952755904"/>
                </xsl:variable>
                <xsl:value-of select="concat(substring-before($var1, '.'), '*')"/>
              </xsl:when>
              <xsl:when test="regex-group(2) = 'pt'">
                <xsl:variable name="var1">
                  <xsl:value-of select="number($wholenumber) * 1"/>
                </xsl:variable>
                <xsl:value-of select="concat($var1, '*')"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="concat($wholenumber, '*')"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:matching-substring>
        </xsl:analyze-string>
      </xsl:attribute>
    </xsl:template>
    Template colspec/@searchtype
    Namespace No namespace
    Match colspec/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="colspec/@searchtype"/>
    Template colspec/@id[not($streamID = ('XX', 'YY', 'ZZ'))]
    Documentation

    Description

    	  .... In the absence of specific instructions elsewhere
    			  in the CI, <sourcexml>@id</sourcexml> is dropped.</li>  
      ***NOTE  -  NEED TO ADD TO THE $streamID LIST ALL STREAMS THAT HAVE SPECIFIC INSTRUCTIONS ON colspec/@id HANDLING!!!  ***  
    Namespace No namespace
    Match colspec/@id[not($streamID = ('XX', 'YY', 'ZZ'))]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="colspec/@id[not($streamID = ('XX', 'YY', 'ZZ'))]"/>
    Template *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@morerows[. = '0']
    Namespace No namespace
    Match *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@morerows[. = '0']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="*[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@morerows[. = '0']"/>
    Template *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@morerows[. != '0']
    Documentation

    Description

     I think we want to preserve morerows if they're not 0, otherwise we lose formatting 
    Namespace No namespace
    Match *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@morerows[. != '0']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="*[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@morerows[. != '0']">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@colsep[. = '0'][not(ancestor-or-self::table//@colsep[. != '0'])]
    Documentation

    Description

      <li>If ALL occurrences of @colsep in one table have a value of
    						zero, remove them all from that table.
    				</li>
    				<li>If ALL occurrences of @rowsep in one table have a value of zero,
    					remove them all from that table. </li>  
    Namespace No namespace
    Match *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@colsep[. = '0'][not(ancestor-or-self::table//@colsep[. != '0'])]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="*[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@colsep[. = '0'][not(ancestor-or-self::table//@colsep[. != '0'])]"/>
    Template *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@rowsep[. = '0'][not(ancestor-or-self::table//@rowsep[. != '0'])]
    Namespace No namespace
    Match *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@rowsep[. = '0'][not(ancestor-or-self::table//@rowsep[. != '0'])]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="*[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@rowsep[. = '0'][not(ancestor-or-self::table//@rowsep[. != '0'])]"/>
    Template *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@colsep[ancestor-or-self::table//@colsep[. != '0']]
    Namespace No namespace
    Match *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@colsep[ancestor-or-self::table//@colsep[. != '0']]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="*[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@colsep[ancestor-or-self::table//@colsep[. != '0']]">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@rowsep[ancestor-or-self::table//@rowsep[. != '0']]
    Namespace No namespace
    Match *[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@rowsep[ancestor-or-self::table//@rowsep[. != '0']]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="*[self::table or self::tgroup or self::colspec or self::thead or self::tbody or self::row or self::entry]/@rowsep[ancestor-or-self::table//@rowsep[. != '0']]">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template thead
    Namespace No namespace
    Match thead
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="thead">
      <thead>
        <xsl:apply-templates select="@* | node()"/>
      </thead>
    </xsl:template>
    Template row
    Namespace No namespace
    Match row
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="row">
      <row>
        <xsl:apply-templates select="@* | node()"/>
      </row>
    </xsl:template>
    Template entry
    Namespace No namespace
    Match entry
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="entry">
      <!-- Awantika: For AU20 entry becomes  primlawhist:histitemdiv/textitem for different @id-->
      <xsl:variable name="docinfoidtext" select="/*/docinfo/docinfo:doc-id/text()"/>
      <xsl:choose>
        <xsl:when test="contains(lower-case($docinfoidtext),'history') and $streamID='AU20'">
          <!--<primlawhist:histitem>-->
          <xsl:if test="@id='HI5'">
            <primlawhist:histitemdiv>
              <xsl:attribute name="divtype">heading</xsl:attribute>
              <xsl:attribute name="status">assent</xsl:attribute>
              <textitem>
                <xsl:apply-templates/>
              </textitem>
            </primlawhist:histitemdiv>
          </xsl:if>
          <xsl:if test="@id='HI7'">
            <primlawhist:histitemdiv>
              <xsl:attribute name="divtype">text</xsl:attribute>
              <xsl:attribute name="status">assent</xsl:attribute>
              <textitem>
                <date>
                  <xsl:apply-templates/>
                </date>
              </textitem>
            </primlawhist:histitemdiv>
          </xsl:if>
          <xsl:if test="@id='HI6'">
            <primlawhist:histitemdiv>
              <!-- Awantika:2017-11-02: Updated for entry/p-limited to create only one textitem -->
              <xsl:choose>
                <xsl:when test="child::p-limited">
                  <xsl:apply-templates/>
                </xsl:when>
                <xsl:otherwise>
                  <textitem>
                    <xsl:apply-templates/>
                  </textitem>
                </xsl:otherwise>
              </xsl:choose>
            </primlawhist:histitemdiv>
          </xsl:if>
          <xsl:if test="normalize-space(.)='Date of assent'">
            <primlawhist:histitemdiv>
              <textitem>
                <xsl:apply-templates/>
              </textitem>
            </primlawhist:histitemdiv>
          </xsl:if>
          <!--</primlawhist:histitem>-->
        </xsl:when>
        <xsl:when test="contains(lower-case($docinfoidtext),'cases') and $streamID='AU20'">
          <xsl:apply-templates/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'overview')">
              <xsl:apply-templates/>
            </xsl:when>
            <xsl:otherwise>
              <entry>
                <!-- NOTE: @colsep and @rowsep should be handled above -->
                <xsl:copy-of select="@align | @char | @charoff | @colname | @nameend | @namest | @valign"/>
                <xsl:apply-templates select="@* except (@align, @char, @charoff, @colname, @nameend, @namest, @valign)"/>
                <xsl:apply-templates/>
              </entry>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template tbody
    Namespace No namespace
    Match tbody
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="tbody">
      <tbody>
        <xsl:apply-templates select="@* | node()"/>
      </tbody>
    </xsl:template>
    Template tbody/@valign
    Namespace No namespace
    Match tbody/@valign
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="tbody/@valign">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template row/@valign
    Namespace No namespace
    Match row/@valign
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="row/@valign">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template entry/@highlight
    Documentation

    Description

     Suppressed the highlight 	
    Namespace No namespace
    Match entry/@highlight
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="entry/@highlight"/>
    Template thead/@valign
    Documentation

    Description

     JD: 2017-06-13: added to "entry" above 
    	<xsl:template match="entry/@valign">
    		<xsl:copy-of select="."/>
    	</xsl:template>
    	
    	<xsl:template match="entry/@align">
    		<xsl:copy-of select="."/>
    	</xsl:template>
    
    JL Got an error due to not dealing with thead/@valign 
    Namespace No namespace
    Match thead/@valign
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="thead/@valign">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template table/@frame
    Namespace No namespace
    Match table/@frame
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="table/@frame">
      <xsl:copy-of select="."/>
    </xsl:template>
    Template table/@pgwide
    Namespace No namespace
    Match table/@pgwide
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="table/@pgwide"/>
    Template text[not(node()) or string() and normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '']
    Documentation

    Description

    Instructions [common element]

    text becomes text, and optional attributes @cont should be suppressed from conversion, @align becomes @align must only be used to preserve mandated horizontal spacing and @align will be moved in parent p in New Lexis conversion.

                        <p><text align="right">TOBY HALLIGAN</text></p>
                    
    Becomes
                        <p align="right"><text>TOBY HALLIGAN</text></p>
                    

    Note: (For CANADA Content Stream only )Only move the text@align to the parent p if it is the only text in p, Otherwise, wrap the text with p and move the @align attribute to the newly created p.

    
    <p>
        <text>Dated at Calgary, Alberta this 31 day of March 1998.</text>
        <text>The Honourable W. Kenneth Moore, Chief Justice of the Court of Queen's Bench of Alberta</text>
        <text align="center">ALBERTA RULES</text>
        <text>Rules of practice made pursuant to subsection 745.64 of the Criminal
            Code to reflect the changes made to the Criminal Code regarding
            applications for reduction in the number of years of imprisonment
            without eligibility for parole.</text>
    </p>                     
                        
    
    
    Becomes
    
    <p>
        <text>Dated at Calgary, Alberta this 31 day of March 1998.</text>
        <text>The Honourable W. Kenneth Moore, Chief Justice of the Court of Queen's Bench of Alberta</text>
    </p>
    <p align="center">
        <text>ALBERTA RULES</text>
    </p>
    <p>
        <text>Rules of practice made pursuant to subsection 745.64 of the Criminal
            Code to reflect the changes made to the Criminal Code regarding
            applications for reduction in the number of years of imprisonment
            without eligibility for parole.</text>
    </p>
    
    

    Description

     <topicref href="../../common_newest/Rosetta_PAC-page-wAncestor-entry-LxAdv-ref.page.dita"/> 
    <xsl:include href="../../modules/nonamespace/Rosetta_PAC-page-wAncestor-entry-LxAdv-ref.page.xsl"/>
     end topichead  table  
     start topichead  text  
     <topicref href="../../common_newest/Rosetta_text-LxAdv-text.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_text-LxAdv-text.dita  
     *****************************************************************************
             * NOTE: @align handling including CA exception is addressed in              *
             * /XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_p-LxAdv-p.xsl *
             * because it can't be run from p/text context node.                         *
             * NOTE: @nl is addressed here and not in                                    *
             * /XSLT/ContentArch/Rosetta-to-LA/modules/nonamespace/Rosetta_p-LxAdv-p.xsl *
             * because it can't be run from p context node.                              *
              ****************************************************************************
     JD: 2017-07-21: added trap for empty node or single whitespace to match DT output.  
    Namespace No namespace
    Match text[not(node()) or string() and normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '']
    Mode #default
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="text[not(node()) or string() and normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '']" priority="2"/>
    Template text
    Namespace No namespace
    Match text
    Mode #default
    References
    Template
    Variable
    Import precedence 0
    Source
    <xsl:template match="text">
      <xsl:variable name="docinfoidtext" select="/*/docinfo/docinfo:doc-id/text()"/>
      <!--  Original Target XPath:  text   -->
      <xsl:choose>
        <xsl:when test="parent::p[@nl]">
          <xsl:call-template name="insert-vertical-space"/>
        </xsl:when>
        <xsl:otherwise>
          <!-- Awantika: For AU20 history text becomes textitem -->
          <xsl:choose>
            <xsl:when test="$streamID='AU20' and parent::p[parent::note[@notetype='xref'][parent::heading]] and contains(lower-case($docinfoidtext),'history')">
              <textitem>
                <xsl:apply-templates/>
              </textitem>
            </xsl:when>
            <xsl:when test="$streamID='AU20' and parent::p[ancestor::source_cttr:annotations[@annotgroup='prov-am']] and contains(lower-case($docinfoidtext),'history')">
              <textitem>
                <xsl:apply-templates/>
              </textitem>
            </xsl:when>
            <!-- Awantika:2017-10-27: p/text will be converted to <textitem> for AU20 for specific scenario -->
            <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'history') and parent::p[ancestor::source_cttr:annotations/heading/note[@id='HI4']]| child::heading/title[.='Assent']">
              <textitem>
                <xsl:apply-templates/>
              </textitem>
            </xsl:when>
            <xsl:otherwise>
              <xsl:choose>
                <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'overview') and ancestor::source_cttr:annotations[@id='OP3' or @id='OI7']/heading/note/l/li">
                  <xsl:apply-templates/>
                </xsl:when>
                <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'overview') and ancestor::source_cttr:annotations[@id='OP15']">
                  <xsl:apply-templates/>
                </xsl:when>
                <!-- Vikas Rohilla : Updated for the UK12                            -->
                <xsl:when test="child::note[@notetype!='xref'][$streamID = 'UK12']">
                  <xsl:apply-templates/>
                </xsl:when>
                <!--Ravikant:2017-12-12: p/inlineobject move in form:p/from:text/figure for hk07  -->
                <xsl:when test="$streamID='HK07' and parent::p[parent::bodytext[parent::level[@leveltype='prec' or @leveltype='prec.grp' or @leveltype='precgrp' or @leveltype='precgrp1' or @leveltype='precgrp2' or parent::comm.chap or ancestor::level[@leveltype = 'prec.grp']]]]">
                  <form:text>
                    <xsl:apply-templates select="node()"/>
                    <xsl:apply-templates select="following-sibling::inlineobject[parent::p]"/>
                  </form:text>
                </xsl:when>
                <!-- Awantika:2017-11-02: p/text will be converted to <textitem> for AU20 for specific scenario -->
                <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'overview') and parent::p[ancestor::source_cttr:annotations[child::heading/note/h[.='Former Title'] or child::heading/title[.='Former Title']]/source_cttr:annot/leg:info/note]">
                  <xsl:apply-templates/>
                </xsl:when>
                <xsl:when test="$streamID='AU20' and contains(lower-case($docinfoidtext),'overview') and parent::p[ancestor::heading[child::title[starts-with(lower-case(.),'international equivalents') or starts-with(lower-case(.),'uniform equivalents')]]/note/l/li]">
                  <xsl:apply-templates/>
                </xsl:when>
                <xsl:otherwise>
                  <text>
                    <!-- <xsl:apply-templates select="node() except refpt"/>-->
                    <!-- Awantika: Updated, as refpt should not be created in the text element -->
                    <!-- Priya Bardhan: Added ci:cite[@type='cite4thisdoc'] in except condition. Since, not required inside text -->
                    <xsl:apply-templates select="@*"/>
                    <xsl:apply-templates select="node() except (refpt,ci:cite[@type='cite4thisdoc'],copyright[$streamID='UK06'])"/>
                    <!-- Awantika: UK11DN- Need to merge the adjacent notes and move them to the end of the existing text  -->
                    <xsl:if test="parent::p[note[@notetype='xref']] and $streamID='UK11DN'">
                      <xsl:for-each-group select="parent::p[note[@notetype='xref']]/node()" group-adjacent="if (self::note) then 0 else 1">
                        <xsl:choose>
                          <xsl:when test="current-grouping-key()=0">
                            <!--  <xsl:apply-templates select="ancestor::p/text"/>-->
                            <marginnote>
                              <ref:anchor>
                                <xsl:attribute name="id">
                                  <xsl:value-of select="generate-id()"/>
                                </xsl:attribute>
                                <xsl:attribute name="anchortype">
                                  <xsl:text>local</xsl:text>
                                </xsl:attribute>
                              </ref:anchor>
                              <bodytext>
                                <xsl:for-each select="current-group()">
                                  <xsl:apply-templates select="@* | node()"/>
                                </xsl:for-each>
                              </bodytext>
                            </marginnote>
                          </xsl:when>
                        </xsl:choose>
                      </xsl:for-each-group>
                    </xsl:if>
                  </text>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template text/@align[$streamID!='CA09']
    Documentation

    Description

     it doesn't make sense to address @align here, but to address it at the paragraph level.
            What do we do for <p> elements that get emptied by having now-empty text? Right now they remain, 
            as passively specified through omission of use case. 
        Updated by Chaitanya foe the text Alignment
    Namespace No namespace
    Match text/@align[$streamID!='CA09']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text/@align[$streamID!='CA09']"/>
    Template text/@cont
    Documentation

    Description

    <xsl:copy-of select="."></xsl:copy-of>
    Namespace No namespace
    Match text/@cont
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="text/@cont"/>
    Template text/@ln.nsprefix
    Namespace No namespace
    Match text/@ln.nsprefix
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="text/@ln.nsprefix"/>
    Template text[$streamID='CA12']/@searchtype
    Namespace No namespace
    Match text[$streamID='CA12']/@searchtype
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text[$streamID='CA12']/@searchtype"/>
    Template insert-vertical-space
    Namespace No namespace
    Used by
    Template
    References
    Template
    Import precedence 0
    Source
    <xsl:template name="insert-vertical-space">
      <xsl:element name="text" namespace="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/">
        <xsl:apply-templates select="@*"/>
        <!--- BRT add number of nl that are in p/@nl -->
        <xsl:call-template name="add_nl">
          <xsl:with-param name="length" select="parent::p/@nl"/>
          <xsl:with-param name="i" select="1"/>
        </xsl:call-template>
        <!-- BRT remove hard-coded nl that are in source -->
        <xsl:apply-templates select="*[not(self::nl or self::refpt)] | text()"/>
      </xsl:element>
    </xsl:template>
    Template add_nl
    Namespace No namespace
    Used by
    References
    Template
    Parameters
    QName Namespace Select
    i No namespace 1
    length No namespace .
    Import precedence 0
    Source
    <xsl:template name="add_nl">
      <xsl:param name="length" select="."/>
      <xsl:param name="i" select="1"/>
      <!-- BRT: create <nl/> for each iteration of @nl value -->
      <xsl:if test="$length > 0">
        <xsl:element name="proc:nl"/>
        <xsl:call-template name="add_nl">
          <xsl:with-param name="length" select="$length - 1"/>
          <xsl:with-param name="i" select="$i + 1"/>
        </xsl:call-template>
      </xsl:if>
    </xsl:template>
    Template text[parent::p[parent::glp:note[parent::text]]][$streamID='CA01' or $streamID='CA02CC' or $streamID='CA04']
    Documentation

    Description

     Vikas Rohilla : Added the template for the streamID CA01    
     Sudhanshu Srivastava : Added StreamID for passthrough. 
    Namespace No namespace
    Match text[parent::p[parent::glp:note[parent::text]]][$streamID='CA01' or $streamID='CA02CC' or $streamID='CA04']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text[parent::p[parent::glp:note[parent::text]]][$streamID='CA01' or $streamID='CA02CC' or $streamID='CA04']">
      <xsl:apply-templates/>
    </xsl:template>
    Template text[parent::p[parent::frm:div | parent::frm:body | parent::li[ancestor::frm:body] | parent::clause[ancestor::frm:div or ancestor::frm:body]]][not(ancestor::footnote or ancestor::note)][$streamID='UK12']
    Documentation

    Description

    Satbir: Set the low priority in below template because this is common template which is already define in "Rosetta_strike-LxAdv-strike.xsl"
     JD: 2017-07-14: just use common template "Rosetta_strike-LxAdv-strike.xsl"; removing this version because: 
    				1) this is the module for the <text> element, not the <strike> element 
    				2) the handling is nearly identical
    				3) this version generates an empty @typestyle attribute, which causes validation errors.
    		
    <xsl:template match="strike" priority="10">
            <strike>
                <xsl:attribute name="typestyle">
                    <xsl:value-of select="@typestyle"/>   
                </xsl:attribute>
                <xsl:apply-templates select="node()"/>
            </strike>
        </xsl:template>
     <!-\- Vikas Rohilla :Added template for the streamID CA01-\->
        <xsl:template match="text[matches(.,'^ARRÊT') or matches(.,'^HELD:') or matches(.,'^DISPOSITIF :')]">
            <xsl:element name="text">
                <xsl:choose>
                    <xsl:when test="child::*">
                        <xsl:apply-templates/>
                    </xsl:when>
                    <xsl:when test="contains(.,'- ')">
                        <xsl:value-of select="substring-after(.,'- ')"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="substring-after(.,'. ')"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:element>
        </xsl:template>
     Vikas Rohilla : created the template for text when ancestor frm:div    
    Namespace No namespace
    Match text[parent::p[parent::frm:div | parent::frm:body | parent::li[ancestor::frm:body] | parent::clause[ancestor::frm:div or ancestor::frm:body]]][not(ancestor::footnote or ancestor::note)][$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text[parent::p[parent::frm:div |                               parent::frm:body |                               parent::li[ancestor::frm:body] |                               parent::clause[ancestor::frm:div or ancestor::frm:body]]][not(ancestor::footnote or ancestor::note)][$streamID='UK12']">
      <form:text>
        <xsl:apply-templates select="@*|node()"/>
      </form:text>
    </xsl:template>
    Template text[parent::p[parent::sigblock[ancestor::frm:div or ancestor::frm:body]]][$streamID='UK12']
    Documentation

    Description

     Vikas Rohilla : created the template for text when ancestor frm:div    
    Namespace No namespace
    Match text[parent::p[parent::sigblock[ancestor::frm:div or ancestor::frm:body]]][$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text[parent::p[parent::sigblock[ancestor::frm:div or ancestor::frm:body]]][$streamID='UK12']">
      <xsl:apply-templates select="@*|node()"/>
    </xsl:template>
    Template text[parent::p[parent::text]][$streamID='UK12']
    Namespace No namespace
    Match text[parent::p[parent::text]][$streamID='UK12']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="text[parent::p[parent::text]][$streamID='UK12']" priority="25">
      <xsl:apply-templates select="@*|node()"/>
    </xsl:template>
    Template text[preceding-sibling::note[@notetype='xref']]
    Namespace No namespace
    Match text[preceding-sibling::note[@notetype='xref']]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text[preceding-sibling::note[@notetype='xref']]">
      <text>
        <xsl:apply-templates select="@*|node()"/>
        <xsl:if test="$streamID='UK12'">
          <xsl:apply-templates select="preceding-sibling::note[@notetype='xref']" mode="note-xref"/>
        </xsl:if>
      </text>
    </xsl:template>
    Template text[normalize-space(.)=''][$streamID=('UK12','UK03')]
    Documentation

    Description

     suppress the empty text    
    Namespace No namespace
    Match text[normalize-space(.)=''][$streamID=('UK12','UK03')]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="text[normalize-space(.)=''][$streamID=('UK12','UK03')]"/>
    Template text[matches(.,'^ $')][$streamID='NZ13']
    Namespace No namespace
    Match text[matches(.,'^ $')][$streamID='NZ13']
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 25
    Source
    <xsl:template match="text[matches(.,'^ $')][$streamID='NZ13']" priority="25">
      <text>
        <xsl:text xml:space="preserve"></xsl:text>
      </text>
    </xsl:template>
    Template text[parent::p[(parent::blockquote|parent::bodytext)[not(ancestor::fnbody)][ancestor::form[ancestor::COMMENTARYDOC|ancestor::LEGDOC]]]]
    Documentation

    Description

    form/bodytext/p/text becomes form:text.

    Source XML

    
    <form>
        <bodytext searchtype="FORM">
            <p>
                <text>
                    <emph typestyle="bf">THIS AGREEMENT</emph> 
                    is made on&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
                    &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
                    &#160;&#160; 2010
                </text>
            </p>
        .......
        .......
            <h align="center">
                1.&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
                The Independent Expert has been appointed by the parties under clause
                .. of the Agreement to assist in resolving the dispute or to 
                resolve the dispute by determining the meaning of clause &hellip;&#160; of
                the Agreement and also to determine which party or parties should 
                pay the costs of and incidental to the resolution of the dispute.
            </h>
            <h align="center">
                2.&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
                The Independent Expert has accepted the appointment, and will assist
                in determining or will determine the dispute in accordance with the 
                terms of this agreement.
            </h>
        ........
        ........
            <h align="center">&#160;</h>
        </bodytext>
    </form>
    
            

    Target XML

    
    <form:form>
        <form:document annotated="false" official="false" typeofdoc="unnamed">
            <form:bodytext>
                <form:p>
                    <form:text>
                        <emph typestyle="bf">THIS AGREEMENT</emph> 
                        is made on&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;
                        &#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;
                        &#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0; 2010
                    </form:text>
                </form:p>
                    ......
                    ......
                <form:h align="center">
                    1.&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;
                    The Independent Expert has been appointed by the parties under clause .. 
                    of the Agreement to assist in resolving the dispute or to resolve 
                    the dispute by determining the meaning of clause &#x2026;&#x00A0;  
                    of the Agreement and also to determine which party or parties 
                    should pay the costs of and incidental to the resolution of the dispute.
                </form:h>
                <form:h align="center">
                    2.&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;
                    The Independent Expert has accepted the appointment, and will 
                    assist in determining or will determine the dispute in accordance
                    with the terms of this agreement.
                </form:h>
                    ......
                    ......
                <form:h align="center">&#x00A0;</form:h>
            </form:bodytext>
        </form:document>
    </form:form>
    
            

    Description

     <topicref href="../../common_newest/Rosetta_form_bodytext_p_text-LxAdv-form.text.dita"/> 
    RS: 02-01-2018 Added Choose Condition for blockquote/p/text Webstar #7078783 
    Namespace No namespace
    Match text[parent::p[(parent::blockquote|parent::bodytext)[not(ancestor::fnbody)][ancestor::form[ancestor::COMMENTARYDOC|ancestor::LEGDOC]]]]
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="text[parent::p[(parent::blockquote|parent::bodytext)[not(ancestor::fnbody)][ancestor::form[ancestor::COMMENTARYDOC|ancestor::LEGDOC]]]]">
      <xsl:choose>
        <xsl:when test="parent::p[parent::blockquote]">
          <text>
            <xsl:apply-templates select="@* | node()"/>
          </text>
        </xsl:when>
        <xsl:otherwise>
          <!--  Original Target XPath:  form:text   -->
          <form:text>
            <xsl:apply-templates select="@* | node()"/>
          </form:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template text[$streamID=('UK14', 'UK12')][parent::p[(parent::blockquote)[ancestor::form[ancestor::COMMENTARYDOC]]]]
    Namespace No namespace
    Match text[$streamID=('UK14', 'UK12')][parent::p[(parent::blockquote)[ancestor::form[ancestor::COMMENTARYDOC]]]]
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 2
    Source
    <xsl:template match="text[$streamID=('UK14', 'UK12')][parent::p[(parent::blockquote)[ancestor::form[ancestor::COMMENTARYDOC]]]]" priority="2">
      <!-- WPK: form:text is not schema valid within blockquote/p -->
      <text>
        <xsl:apply-templates select="@* | node()"/>
      </text>
    </xsl:template>
    Template title[not( normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '')]
    Documentation

    Description

    Instructions [common element]

    title becomes title with attributes:

    • @inline becomes @inline with tokenized values of "true" and "false"
    • @align becomes @align with tokenized values and populated as:
      • title[@align="left"]
      • title[@align="right"]
      • title[@align="center"]

    If the input document has title/defterm scenario then defterm within a title can be dropped, but the content of the tag is retained and no text is dropped.

    Exceptional scenario for CA Indices and CA06 Regs: title/nl becomes title. nl will be replaces by a white space in the target.

    Exceptional scenario for CA Indices: When title is an child of docinfo:hierlev/heading and contains word TITLE: or NAME: or SITE: then conversion should drop the word TITLE: or NAME: or SITE: from conversion.

    Source XML

    
    <heading>
    	  <title align="center">Consideration</title>
    </heading>
    ....
    ....
    <heading>
    	  <title inline="false">Summary</title>
    </heading>
    
    		

    Target XML

    
    <heading>
      <title align="center">Consideration</title>
    </heading>
    ....
    ....
    <heading>
    	  <title inline="false">Summary</title>
    </heading>
    
    		

    Source XML having title/nl

    
    <title> English-French<nl/>Trade-mark Lexicon</title>
    
    		

    Target XML

    
    <title> English-French Trade-mark Lexicon</title>
    
    		

    Source XML contains word "TITLE: " in title

    <docinfo:hierlev role="me">
        <heading>
            <title>TITLE: Criminal Code French/English consolidation 2010 / Code criminal codification bilingue
                2010. 2010 ed. </title>
        </heading>
    </docinfo:hierlev>
    		

    Target XML

    <doc:hierlev>
        <heading>
            <title>Criminal Code French/English consolidation 2010 / Code criminal codification bilingue
                2010. 2010 ed. </title>
        </heading>
    </doc:hierlev>
    	

    Description

     end topichead  text  
     rosetta element: title 
     <topicref href="../../common_newest/Rosetta_title-LxAdv-title.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_title-LxAdv-title.dita  
     JD: 2017-07-24: added 'replace()' function to get rid of characters not handled by normalize-space(e.g., nbsp) 
    Namespace No namespace
    Match title[not( normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '')]
    Mode #default
    References
    Parameters
    QName Namespace Select Type
    titleStringsToRemove No namespace if ($streamID = 'CA15') then ( 'TITLE: ' , 'TITRE: ' , 'TITLE/TITRE:' , 'TITRE/TITLE:','CITED/CITÉ: ', 'CITÉ/CITED: ', 'CITE/CITED: ', 'CITED: ' ) else ( 'TITLE:' , 'NAME:' , 'SITE:' ,':' ) xs:string*
    Import precedence 0
    Source
    <xsl:template match="title[not( normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '')]">
      <!--<xsl:param name="titleStringsToRemove" as="xs:string*" select="( 'TITLE:' , 'NAME:' , 'SITE:' ,':' )"/>	-->
      <!-- these are regular expressions  -->
      <!--pawan:added for CA15-->
      <xsl:param name="titleStringsToRemove" as="xs:string*" select="if ($streamID = 'CA15') then ( 'TITLE: ' , 'TITRE: ' , 'TITLE/TITRE:' , 'TITRE/TITLE:','CITED/CITÉ: ', 'CITÉ/CITED: ', 'CITE/CITED: ', 'CITED: ' )  else  ( 'TITLE:' , 'NAME:' , 'SITE:' ,':' )"/>
      <xsl:variable name="outputText" as="xs:string*">
        <xsl:apply-templates/>
      </xsl:variable>
      <xsl:variable name="subtitletext"/>
      <!--  Original Target XPath:  title   -->
      <xsl:choose>
        <!-- Due to jrnl:prelim outputting as nitf:hedline/nitf:h1, which does not have a child title. - See HK02_Articles for example -->
        <xsl:when test="parent::heading/parent::jrnl:prelim">
          <xsl:apply-templates/>
        </xsl:when>
        <!-- do not output empty element title when it only contains refpt and is a child of heading -->
        <xsl:when test="parent::heading and refpt and not(text()) and not(child::*[2])"/>
        <!--SNB 2017-10-17 add title child of transcript for new embedded video content. Note that transcript 
    				is a new element, so this cant interfere with any other processing-->
        <xsl:when test="parent::transcript">
          <h>
            <xsl:apply-templates select="@*"/>
            <!-- refpts can't be output in title elements in target schemas -->
            <xsl:apply-templates select="node() except refpt"/>
          </h>
        </xsl:when>
        <xsl:otherwise>
          <title>
            <xsl:apply-templates select="@*"/>
            <xsl:choose>
              <xsl:when test=" $streamID = 'CA11' or $streamID = 'CA15' and parent::heading[parent::docinfo:hierlev] ">
                <!--  remove any occurrence of $titleStringsToRemove strings but assume case sensitive   -->
                <xsl:sequence select=" lnf:removeSequenceOfStrings( string-join( $outputText , '' ) , $titleStringsToRemove , false() ) "/>
              </xsl:when>
              <!-- Vikas Rohilla : Added for the streamID CA01	-->
              <xsl:when test="$streamID ='CA01' and ancestor::case:constituents">
                <xsl:sequence select=" lnf:removeSequenceOfStrings( string-join( $outputText , '' ) , $titleStringsToRemove , false() ) "/>
              </xsl:when>
              <!-- Awantika: Added for AU20 -->
              <xsl:when test="$streamID='AU20' and following-sibling::subtitle">
                <xsl:value-of select="concat(.,' ','(',following-sibling::subtitle,')')"/>
              </xsl:when>
              <xsl:otherwise>
                <!-- refpts can't be output in title elements in target schemas -->
                <xsl:apply-templates select="node() except refpt"/>
              </xsl:otherwise>
            </xsl:choose>
          </title>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Template title[normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '']
    Documentation

    Description

        From Rosetta_Elements-LxAdv-Empty_Elements.dita / .xsl   
    <xsl:template match="title[ normalize-space(string-join( . , '') ) = '' ]"/>
     JD: 2017-07-24: could probably be combined with above, but shouldn't hurt 
    Namespace No namespace
    Match title[normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '']
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="title[normalize-space(replace(., '^[\t\p{Zs}]+$', '')) = '']"/>
    Template title/@inline
    Namespace No namespace
    Match title/@inline
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="title/@inline">
      <!--  Original Target XPath:  @inline   -->
      <xsl:copy-of select=" . "/>
    </xsl:template>
    Template title/@align
    Namespace No namespace
    Match title/@align
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="title/@align">
      <!--  Original Target XPath:  @align   -->
      <xsl:copy-of select=" . "/>
    </xsl:template>
    Template title/defterm
    Namespace No namespace
    Match title/defterm
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="title/defterm">
      <!--  Original Target XPath:  title   -->
      <xsl:apply-templates select="@* | node()"/>
    </xsl:template>
    Template title/nl[ $streamID = ( 'CA11' ) ]
    Namespace No namespace
    Match title/nl[ $streamID = ( 'CA11' ) ]
    Mode #default
    References
    Variable
    Import precedence 0
    Source
    <xsl:template match="title/nl[ $streamID = ( 'CA11' ) ]">
      <!--  output a space.  Note that otherwise nl becomes proc:nl which is allowed under title   -->
      <xsl:text> </xsl:text>
    </xsl:template>
    Template title/@searchtype
    Documentation

    Description

     JL suppress searchtype 
    Namespace No namespace
    Match title/@searchtype
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="title/@searchtype"/>
    Template title/num[$streamID='CA09']/@searchtype
    Namespace No namespace
    Match title/num[$streamID='CA09']/@searchtype
    Mode #default
    References
    Variable
    Import precedence 0
    Priority 30
    Source
    <xsl:template match="title/num[$streamID='CA09']/@searchtype" priority="30"/>
    Template toc
    Documentation

    Description

    toc becomes toc. The children of toc are handled as follows:

    • heading becomes heading.
    • toc-entry becomes toc-entry. The children of toc-entry are handled as follows:
      • heading becomes heading.

    Source XML

    
    <toc>
        <heading>
            <title>
                <emph typestyle="bf">Table of sections</emph>
            </title>
        </heading>
        <toc-entry>
            <heading>
                <desig>
                    <designum>1-1</designum>
                </desig>
                <title>Short title</title>
            </heading>
        </toc-entry>
    </toc>
    
    	

    Target XML

    
    <toc>
        <heading>
            <title>
                <emph typestyle="bf">Table of sections</emph>
            </title>
        </heading>
        <toc-entry>
            <heading>
                <desig>1-1</desig>
                <title>Short title</title>
            </heading>
        </toc-entry>
    </toc>
    
    	

    If toc has a child page with a following sibling toc-entry, page should map to toc-entry/ref:page. The parent of ref:page should be the toc-entry that has been mapped from the following sibling of toc/page.

    Source XML

    
    <toc>
        ...
        <toc-entry>
            <heading>
                <title>Cash flow problems..............................................................</title>
                <desig>
                    <designum>22</designum>
                </desig>
            </heading>
        </toc-entry>
        <page reporter="urj" count="2" text="BC9801738 at " subdoc="true"/>
        <toc-entry>
            <heading>
                <title>Lack of accounting information..................................................</title>
                <desig>
                    <designum>23</designum>
                </desig>
            </heading>
        </toc-entry>
        ...
    </toc>
    
    	

    Target XML

    
    <toc>
        ...
        <toc-entry>
            <heading>
                <title>Cash flow problems..............................................................</title>
                <desig value="22">22</desig>
            </heading>
        </toc-entry>
        <toc-entry>
            <ref:page num="2" page-scheme-type="reporter-abbreviation" page-scheme="urj"/>
            <heading>
                <title>Lack of accounting information..................................................</title>
                <desig value="23">23</desig>
            </heading>
        </toc-entry>
        ...
    </toc>
    
    	

    Directions specific AU01 caselaw (all DPSIs) and NZ03 caselaw (only DPSI 02IT)

    If desig/designum occurs after title, then the following directions should be followed:

    • title becomes title as usual.
    • desig/designum becomes toc-ref.

    Source XML

    
    <docinfo>
        <docinfo:dpsi id-string="02IT"/>
        ...
    </docinfo>
    ...
    <toc>
        <toc-entry>
            <heading>
                <title>Introduction</title>
                <desig>
                    <designum>1</designum>
                </desig>
            </heading>
        </toc-entry>
        <toc-entry>
            <heading>
                <title>What the Crown alleged against the appellant</title>
                <desig>
                    <designum>5</designum>
                </desig>
            </heading>
        </toc-entry>
        <toc-entry>
            <heading>
                <title>Overview of the appeal</title>
                <desig>
                    <designum>17</designum>
                </desig>
            </heading>
        </toc-entry>
        ...
    </toc>
    
    	

    Target XML

    
    <toc>
        <toc-entry>
            <heading>
                <title>Introduction</title>
            </heading>
            <toc-ref>1</toc-ref>
        </toc-entry>
        <toc-entry>
            <heading>
                <title>What the Crown alleged against the appellant</title>
            </heading>
            <toc-ref>5</toc-ref>
        </toc-entry>
        <toc-entry>
            <heading>
                <title>Overview of the appeal</title>
            </heading>
            <toc-ref>17</toc-ref>
        </toc-entry>
        ...
    </toc>
    
    	

    Scenario for AU01 caselaw

    When entry-pageref is a child of toc-entry then toc-entry becomes toc-entry and entry-pageref becomes toc-pageref.

    Source XML

    <toc>
        <toc-entry>
            <heading>
                <title>Table of Contents</title>
            </heading>
        </toc-entry>
        <toc-entry>
            <heading>
                <title>I. Introduction</title>
            </heading>
            <entry-pageref>[1]</entry-pageref>
        </toc-entry>
        <toc-entry>
            <heading>
                <title>II. Tom&#x2019;s case at trial</title>
            </heading>
            <entry-pageref>[13]</entry-pageref>
        </toc-entry>
        ...
    </toc>
    	

    Target XML

    <toc>
        <toc-entry>
            <heading>
                <title>Table of Contents</title>
            </heading>
        </toc-entry>
        <toc-entry>
            <heading>
                <title>I. Introduction</title>
            </heading>
            <toc-pageref>[1]</toc-pageref>
        </toc-entry>
        <toc-entry>
            <heading>
                <title>II. Tom&#x2019;s case at trial</title>
            </heading>
            <toc-pageref>[13]</toc-pageref>
        </toc-entry>
        ...
    </toc>
    	

    Description

     rosetta element: toc 
     Awantika: Completed 
     <topicref href="../../common_newest/Rosetta_AU_NZ_caselaw_toc-LxAdv-toc.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_AU_NZ_caselaw_toc-LxAdv-toc.dita  
    Namespace No namespace
    Match toc
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="toc">
      <!--  Original Target XPath:  toc   -->
      <toc>
        <xsl:apply-templates select="@* | node()"/>
      </toc>
    </xsl:template>
    Template toc-entry
    Namespace No namespace
    Match toc-entry
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="toc-entry">
      <!--  Original Target XPath:  toc-entry   -->
      <toc-entry>
        <xsl:if test="following-sibling::page">
          <xsl:apply-templates select="following-sibling::page[1]"/>
          <!--<xsl:if test="child::entry-pageref">
    		            <toc-pageref>
    		                <xsl:apply-templates/>
    		            </toc-pageref>
    		        </xsl:if>-->
        </xsl:if>
        <xsl:if test="child::heading[child::desig/designum]">
          <toc-ref>
            <xsl:apply-templates select="@* | node()"/>
          </toc-ref>
        </xsl:if>
        <xsl:apply-templates/>
      </toc-entry>
    </xsl:template>
    Template entry-pageref
    Namespace No namespace
    Match entry-pageref
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="entry-pageref">
      <toc-pageref>
        <xsl:apply-templates select="@* | node()"/>
      </toc-pageref>
    </xsl:template>
    Template url/remotelink
    Documentation
    Namespace No namespace
    Match url/remotelink
    Mode #default
    References
    Import precedence 0
    Priority 25
    Source
    Template url[remotelink]
    Namespace No namespace
    Match url[remotelink]
    Mode #default
    Import precedence 0
    Source
    Template emph[ancestor::remotelink[parent::url]]
    Documentation

    Description

     JL need to add emph passthrough to make this validate! 
    Namespace No namespace
    Match emph[ancestor::remotelink[parent::url]]
    Mode #default
    Import precedence 0
    Priority 30
    Source
    <xsl:template match="emph[ancestor::remotelink[parent::url]]" priority="30">
      <xsl:apply-templates/>
    </xsl:template>
    Template verbatim
    Documentation

    Description

    Instructions [common element]

    verbatim becomes verbatim with attribute @verbatimclass becomes @verbatimclass

    Source XML

     <p> <text> <verbatim verbatimclass="verbatim">** Editor's
              Table **<nl/> <nl/> Provision Changed by In force Authority<nl/>
              <nl/> 487.0911 2005 c25 s11 2008 Jan 1 SI/2007-108<nl/> *****
              </verbatim> </text> </p> 

    Target XML

     <p> <text> <verbatim verbatimclass="verbatim">** Editor's
              Table **<proc:nl/> <proc:nl/> Provision Changed by In force
              Authority<proc:nl/> <proc:nl/> 487.0911 2005 c25 s11 2008 Jan 1
              SI/2007-108<proc:nl/> *****</verbatim> </text> </p> 

    Description

     rosetta element: verbatim 
     <topicref href="../../common_newest/Rosetta_verbatim-LxAdv-verbatim.dita"/> 
      @@@ This file has been autogenerated.  Remove this comment after manual development complete! @@@  
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_verbatim-LxAdv-verbatim.dita  
    <xsl:message>Rosetta_verbatim-LxAdv-verbatim.xsl requires manual development!</xsl:message> 
    Namespace No namespace
    Match verbatim
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="verbatim">
      <!--  Original Target XPath:  verbatim   -->
      <verbatim>
        <xsl:apply-templates select="@* | node()"/>
      </verbatim>
    </xsl:template>
    Template @verbatimclass
    Namespace No namespace
    Match @verbatimclass
    Mode #default
    Import precedence 0
    Source
    <xsl:template match="@verbatimclass">
      <!--  Original Target XPath:  @verbatimclass   -->
      <xsl:attribute name="verbatimclass">
        <xsl:value-of select="."/>
      </xsl:attribute>
    </xsl:template>
    Parameter outputSchemaLoc
    Namespace No namespace
    Select 'http://www.lexisnexis.com/xmlschemas/content/legal/courtcase/1/ http://www.lexisnexis.com/xmlschemas/content/legal/courtcase/1/sch_courtcase.xsd'
    Source
    <xsl:param name="outputSchemaLoc" select="'http://www.lexisnexis.com/xmlschemas/content/legal/courtcase/1/ http://www.lexisnexis.com/xmlschemas/content/legal/courtcase/1/sch_courtcase.xsd'"/>
    Parameter dpsi
    Namespace No namespace
    Select 'From LBU Manifest File'
    Type xs:string
    Used by
    Source
    <xsl:param name="dpsi" as="xs:string" select=" 'From LBU Manifest File' "/>
    Parameter smi
    Namespace No namespace
    Select 'From LBU Manifest File'
    Type xs:string
    Used by
    Template
    Source
    <xsl:param name="smi" as="xs:string" select="'From LBU Manifest File'"/>
    Parameter inlineobjBoilerplateFiles
    Namespace No namespace
    Used by
    Source
    <xsl:param name="inlineobjBoilerplateFiles"/>
    Parameter inlineobjFilesToSuppress
    Namespace No namespace
    Select ('1.gif', '2.gif', '3.gif', '4.gif', '5.gif', 'IconSignalPositive.gif', 'IconSignalNegative.gif', 'IconSignalNeutral.gif', 'IconSignalPossibleNegative.gif', 'IconSignalCiteInfoOnly.gif', 'cbcc.gif', 'leg1.gif', 'mb.gif', 'au_repealed.gif', 'au_exclaim.gif', '1.png', '2.png', '3.png', '4.png', '5.png', 'IconSignalPositive.png', 'IconSignalNegative.png', 'IconSignalNeutral.png', 'IconSignalPossibleNegative.png', 'IconSignalCiteInfoOnly.png', 'cbcc.png', 'leg1.png', 'mb.png', 'au_repealed.png', 'au_exclaim.png')
    Used by
    Source
    <xsl:param name="inlineobjFilesToSuppress" select="('1.gif', '2.gif', '3.gif', '4.gif', '5.gif', 'IconSignalPositive.gif', 'IconSignalNegative.gif', 'IconSignalNeutral.gif', 'IconSignalPossibleNegative.gif', 'IconSignalCiteInfoOnly.gif', 'cbcc.gif', 'leg1.gif', 'mb.gif', 'au_repealed.gif', 'au_exclaim.gif', '1.png', '2.png', '3.png', '4.png', '5.png', 'IconSignalPositive.png', 'IconSignalNegative.png', 'IconSignalNeutral.png', 'IconSignalPossibleNegative.png', 'IconSignalCiteInfoOnly.png', 'cbcc.png', 'leg1.png', 'mb.png', 'au_repealed.png', 'au_exclaim.png')"/>
    Parameter outputEmbeddedCitations
    Documentation

    Description

     Set as 'true' if you want inline (embedded) citations.  
    Namespace No namespace
    Select 'false'
    Type xs:string
    Used by
    Variable
    Source
    <xsl:param name="outputEmbeddedCitations" as="xs:string" select="'false'"/>
    Parameter visfXmlOutputLevel
    Documentation

    Description

     Set as 'segmentsOnly' if you want as flat as possible (only segement elements containing strings) when performing transforms to VisfXML.  
    Namespace No namespace
    Select 'false'
    Type xs:string
    Source
    <xsl:param name="visfXmlOutputLevel" as="xs:string" select="'false'"/>
    Parameter passThroughGlobalEntityMarkup
    Documentation

    Description

     Set as 'true' if you want globalentity:* pass-through.  
    Namespace No namespace
    Select 'false'
    Type xs:string
    Used by
    Source
    <xsl:param name="passThroughGlobalEntityMarkup" as="xs:string" select="'false'"/>
    Parameter outputUnmatchedElements
    Documentation

    Description

     Set as 'true' if you want errors thrown for elements or attributes not explicitly matched elsewhere; elements are output and wrapped in error element.  Set to 'false' to drop entirely plus no errors; set to 'noErrors' to suppress errors but still copy elements and attributes to the output; set to ROCKET (default) for error messages to be output with offending element/attribute suppressed (no forced schema validation error).  
    Namespace No namespace
    Select 'ROCKET'
    Type xs:string
    Used by
    Template
    Variable
    Source
    <xsl:param name="outputUnmatchedElements" as="xs:string" select=" 'ROCKET' "/>
    Parameter debugMode
    Namespace No namespace
    Select 'false'
    Type xs:string
    Used by
    Variable
    Source
    <xsl:param name="debugMode" as="xs:string" select=" 'false' "/>
    Parameter sourceFilename
    Documentation

    Description

     Current date/time and file being processed; these global variables only really used for debug/error processing.  current-dateTime() outputs in YYYY-MM-DDTHH:MM:SS-TZ:TZ format when we need YYYY-MM-DD HH:MI:SS   
    Namespace No namespace
    Select tokenize( document-uri(/) , '/' )[last()]
    Type xs:string*
    Used by
    Variable
    Source
    <xsl:param name="sourceFilename" as="xs:string*" select=" tokenize( document-uri(/) , '/' )[last()] "/>
    Parameter bundleID
    Documentation

    Description

      Helpfule for Fab pipeline processing to indicate bundle ID   
    Namespace No namespace
    Select 'UNKNOWN'
    Type xs:string
    Used by
    Source
    <xsl:param name="bundleID" as="xs:string" select=" 'UNKNOWN' "/>
    Parameter legacy-filename
    Namespace No namespace
    Select ''
    Type xs:string
    Used by
    Source
    <xsl:param name="legacy-filename" as="xs:string" select=" '' "/>
    Variable streamID
    Namespace No namespace
    Select 'AU01'
    Type xs:string
    Used by
    Templates
    h;
    p;
    Source
    <xsl:variable name="streamID" as="xs:string" select="'AU01'"/>
    Variable outputCitation
    Namespace No namespace
    Select if ($outputEmbeddedCitations = 'true') then true() else false()
    Type xs:boolean
    References
    Source
    <xsl:variable name="outputCitation" as="xs:boolean" select="if ($outputEmbeddedCitations = 'true') then true() else false()"/>
    Variable passThroughGlobalEntity
    Namespace No namespace
    Select if ($passThroughGlobalEntityMarkup = 'true') then true() else false()
    Type xs:boolean
    References
    Source
    <xsl:variable name="passThroughGlobalEntity" as="xs:boolean" select="if ($passThroughGlobalEntityMarkup = 'true') then true() else false()"/>
    Variable debug
    Namespace No namespace
    Select if ($debugMode = 'true') then true() else false()
    Type xs:boolean
    References
    Parameter
    Source
    <xsl:variable name="debug" as="xs:boolean" select="if ($debugMode = 'true') then true() else false()"/>
    Variable fileName
    Namespace No namespace
    Select if (string($sourceFilename) = '') then 'UNKNOWN' else $sourceFilename
    Type xs:string
    Used by
    References
    Parameter
    Source
    <xsl:variable name="fileName" as="xs:string" select="if (string($sourceFilename) = '') then 'UNKNOWN' else $sourceFilename"/>
    Variable dateTime
    Namespace No namespace
    Select translate( substring( string(current-dateTime()) , 1 , 19 ) , 'T' , ' ' )
    Type xs:string
    Source
    <xsl:variable name="dateTime" as="xs:string" select=" translate( substring( string(current-dateTime()) , 1 , 19 ) , 'T' , ' ' ) "/>
    Variable acceptableID_Chars
    Documentation

    Description

      @SBy:  2016-09-20  ROM 1218 IRM Strategic:  add variables introduced by copyright and LEGDOC-LDC conversions  
    Namespace No namespace
    Select 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_:'
    Type xs:string
    Used by
    Source
    <xsl:variable name="acceptableID_Chars" as="xs:string" select=" 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_:' "/>
    Variable unallowedFirstCharAcceptableID_Chars
    Namespace No namespace
    Select '0123456789.-'
    Type xs:string
    Used by
    Source
    <xsl:variable name="unallowedFirstCharAcceptableID_Chars" as="xs:string" select=" '0123456789.-' "/>
    Variable irmSection
    Namespace No namespace
    Select substring-after( /LEGDOC-LDC/lnv:CITE/ref:cite4thisresource/source_lnci:cite/source_lnci:content , 'IRM ' )
    Type xs:string
    Source
    <xsl:variable name="irmSection" as="xs:string" select="substring-after( /LEGDOC-LDC/lnv:CITE/ref:cite4thisresource/source_lnci:cite/source_lnci:content , 'IRM ' )"/>
    Variable vUpperCase
    Documentation

    Description

     Creating variable to hold all upper-case letters 
    Namespace No namespace
    Select 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    Type xs:string
    Source
    <xsl:variable name="vUpperCase" as="xs:string" select=" 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' "/>
    Variable vLowerCase
    Documentation

    Description

     Creating variable to hold all lower-case letters 
    Namespace No namespace
    Select 'abcdefghijklmnopqrstuvwxyz'
    Type xs:string
    Source
    <xsl:variable name="vLowerCase" as="xs:string" select=" 'abcdefghijklmnopqrstuvwxyz' "/>
    Variable outputErrors
    Namespace No namespace
    Select if ($outputUnmatchedElements = 'true') then true() else false()
    Type xs:boolean
    Used by
    Template
    References
    Source
    <xsl:variable name="outputErrors" as="xs:boolean" select="if ($outputUnmatchedElements = 'true') then true() else false()"/>
    Variable lexisAdvNamespaces
    Documentation

    Description

    • xmlns="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/"
    • xmlns:abstract="urn:x-lexisnexis:content:abstract:sharedservices:1"
    • xmlns:admincode="http://www.lexisnexis.com/xmlschemas/content/legal/administrative-code/1/"
    • xmlns:admindecision="urn:x-lexisnexis:content:administrative-decision:sharedservices:1"
    • xmlns:admindoc="urn:x-lexisnexis:content:administrative-document:sharedservices:1"
    • xmlns:annot="http://www.lexisnexis.com/xmlschemas/content/shared/annotations/1/"
    • xmlns:annotinfo="http://www.lexisnexis.com/xmlschemas/content/shared/annotations-info/1/"
    • xmlns:article="urn:x-lexisnexis:content:article:sharedservices:1"
    • xmlns:base="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/"
    • xmlns:biblio="urn:x-lexisnexis:content:bibliography:sharedservices:1"
    • xmlns:billhist="urn:x-lexisnexis:content:billhistory:sharedservices:1"
    • xmlns:billtrack="urn:x-lexisnexis:content:billtracking:1"
    • xmlns:casedigest="http://www.lexisnexis.com/xmlschemas/content/legal/case-digest/1/"
    • xmlns:casehist="http://www.lexisnexis.com/xmlschemas/content/legal/case-history/1/"
    • xmlns:caseinfo="http://www.lexisnexis.com/xmlschemas/content/legal/case-information/1/"
    • xmlns:casesum="http://www.lexisnexis.com/xmlschemas/content/legal/case-summary/1/"
    • xmlns:cfi="http://www.lexisnexis.com/xmlschemas/content/shared/cite-finding-information/1/"
    • xmlns:classify="http://www.lexisnexis.com/xmlschemas/content/shared/classification/1/"
    • xmlns:compcase="urn:x-lexisnexis:content:compositecourtcase:sharedservices:1"
    • xmlns:const="http://www.lexisnexis.com/xmlschemas/content/legal/constitution/1/"
    • xmlns:contact="http://www.lexisnexis.com/xmlschemas/content/shared/contact/1/"
    • xmlns:courtcase="http://www.lexisnexis.com/xmlschemas/content/legal/courtcase/1/"
    • xmlns:courtfiling="http://www.lexisnexis.com/xmlschemas/content/legal/courtfiling/1/"
    • xmlns:courtorder="urn:x-lexisnexis:content:courtorder:sharedservices:1"
    • xmlns:courtrule="http://www.lexisnexis.com/xmlschemas/content/legal/courtrule/1/"
    • xmlns:cttr="urn:x-lexisnexis:content:citator:sharedservices:1"
    • xmlns:currencystatement="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/currencystatement"
    • xmlns:dc="http://purl.org/dc/elements/1.1/"
    • xmlns:dcterms="http://purl.org/dc/terms/"
    • xmlns:decision="http://www.lexisnexis.com/xmlschemas/content/legal/decision/1/"
    • xmlns:dict="urn:x-lexisnexis:content:dict:sharedservices:1"
    • xmlns:directory="urn:x-lexisnexis:content:directory:sharedservices:1"
    • xmlns:doc="http://www.lexisnexis.com/xmlschemas/content/shared/document-level-metadata/1/"
    • xmlns:entity="http://www.lexisnexis.com/xmlschemas/content/shared/identified-entities/1/"
    • xmlns:form="http://www.lexisnexis.com/xmlschemas/content/shared/form/1/"
    • xmlns:funddoc="urn:x-lexisnexis:content:fundamentallegaldocument:sharedservices:1"
    • xmlns:globalentity="urn:x-lexisnexis:content:identified-entities:global:1"
    • xmlns:guid="urn:x-lexisnexis:content:guid:global:1"
    • xmlns:index="urn:x-lexisnexis:content:publicationindex:sharedservices:1"
    • xmlns:jurisinfo="http://www.lexisnexis.com/xmlschemas/content/legal/jurisdiction-info/1/"
    • xmlns:legis="http://www.lexisnexis.com/xmlschemas/content/legal/legislation/1/"
    • xmlns:legishist="http://www.lexisnexis.com/xmlschemas/content/legal/legislation-history/1/"
    • xmlns:legisinfo="http://www.lexisnexis.com/xmlschemas/content/legal/legislation-info/1/"
    • xmlns:lnci="http://www.lexisnexis.com/xmlschemas/content/shared/citations/1/"
    • xmlns:lndocmeta="http://www.lexisnexis.com/xmlschemas/content/shared/lndocmeta/1/"
    • xmlns:lnmeta="http://www.lexisnexis.com/xmlschemas/content/shared/lexisnexis-metadata/1/"
    • xmlns:lnsys="http://www.lexisnexis.com/xmlschemas/content/shared/lnsys/1/"
    • xmlns:lntbl="http://www.lexisnexis.com/xmlschemas/content/shared/lexisnexis-table-extensions/1/"
    • xmlns:location="http://www.lexisnexis.com/xmlschemas/content/shared/location/1/"
    • xmlns:lpa="urn:x-lexisnexis:content:parameter:lexispracticeadvisor:1"
    • xmlns:navaid="urn:x-lexisnexis:content:navigationaid:sharedservices:1"
    • xmlns:newsitem="http://www.lexisnexis.com/xmlschemas/content/news/newsitem/1/"
    • xmlns:nitf="http://iptc.org/std/NITF/2006-10-18/"
    • xmlns:org="urn:x-lexisnexis:content:organization:sharedservices:1"
    • xmlns:person="http://www.lexisnexis.com/xmlschemas/content/shared/person/1/"
    • xmlns:primlaw="http://www.lexisnexis.com/xmlschemas/content/legal/primarylaw/1/"
    • xmlns:primlawhist="http://www.lexisnexis.com/xmlschemas/content/legal/primarylaw-history/1/"
    • xmlns:primlawinfo="http://www.lexisnexis.com/xmlschemas/content/legal/primarylaw-info/1/"
    • xmlns:proc="http://www.lexisnexis.com/xmlschemas/content/shared/process-elements/1/"
    • xmlns:pubfm="http://www.lexisnexis.com/xmlschemas/content/shared/publication-front-matter/1/"
    • xmlns:pubinfo="http://www.lexisnexis.com/xmlschemas/content/shared/publication-info/1/"
    • xmlns:pubup="http://www.lexisnexis.com/xmlschemas/content/shared/publication-update/1/"
    • xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    • xmlns:ref="http://www.lexisnexis.com/xmlschemas/content/shared/reference/1/"
    • xmlns:register="http://www.lexisnexis.com/xmlschemas/content/legal/register/1/"
    • xmlns:registerinfo="http://www.lexisnexis.com/xmlschemas/content/legal/register-info/1/"
    • xmlns:regulation="urn:x-lexisnexis:content:regulation:sharedservices:1"
    • xmlns:rfc="http://www.lexisnexis.com/xmlschemas/content/legal/reason-for-citing/1/"
    • xmlns:seclaw="http://www.lexisnexis.com/xmlschemas/content/legal/secondary-law/1/"
    • xmlns:statcode="http://www.lexisnexis.com/xmlschemas/content/legal/statutorycode/1/"
    • xmlns:tei="http://www.tei-c.org/ns/1.0/"
    • xmlns:topic="urn:x-lexisnexis:content:topic:global:1"
    • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    Description

      functions END  
     Awantika: Completed 
     <topicref href="AU01_namespaces.dita"/> 
    Namespace No namespace
    Type element()
    Used by
    Source
    <xsl:variable name="lexisAdvNamespaces" as="element()">
      <lexisAdvNamepaces>
        <lexisAdvNamespace>xmlns="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:abstract="urn:x-lexisnexis:content:abstract:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:admincode="http://www.lexisnexis.com/xmlschemas/content/legal/administrative-code/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:admindecision="urn:x-lexisnexis:content:administrative-decision:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:admindoc="urn:x-lexisnexis:content:administrative-document:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:annot="http://www.lexisnexis.com/xmlschemas/content/shared/annotations/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:annotinfo="http://www.lexisnexis.com/xmlschemas/content/shared/annotations-info/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:article="urn:x-lexisnexis:content:article:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:base="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:biblio="urn:x-lexisnexis:content:bibliography:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:billhist="urn:x-lexisnexis:content:billhistory:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:billtrack="urn:x-lexisnexis:content:billtracking:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:casedigest="http://www.lexisnexis.com/xmlschemas/content/legal/case-digest/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:casehist="http://www.lexisnexis.com/xmlschemas/content/legal/case-history/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:caseinfo="http://www.lexisnexis.com/xmlschemas/content/legal/case-information/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:casesum="http://www.lexisnexis.com/xmlschemas/content/legal/case-summary/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:cfi="http://www.lexisnexis.com/xmlschemas/content/shared/cite-finding-information/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:classify="http://www.lexisnexis.com/xmlschemas/content/shared/classification/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:compcase="urn:x-lexisnexis:content:compositecourtcase:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:const="http://www.lexisnexis.com/xmlschemas/content/legal/constitution/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:contact="http://www.lexisnexis.com/xmlschemas/content/shared/contact/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:courtcase="http://www.lexisnexis.com/xmlschemas/content/legal/courtcase/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:courtfiling="http://www.lexisnexis.com/xmlschemas/content/legal/courtfiling/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:courtorder="urn:x-lexisnexis:content:courtorder:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:courtrule="http://www.lexisnexis.com/xmlschemas/content/legal/courtrule/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:cttr="urn:x-lexisnexis:content:citator:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:currencystatement="http://www.lexisnexis.com/xmlschemas/content/shared/base/1/currencystatement"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:dc="http://purl.org/dc/elements/1.1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:dcterms="http://purl.org/dc/terms/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:decision="http://www.lexisnexis.com/xmlschemas/content/legal/decision/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:dict="urn:x-lexisnexis:content:dict:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:directory="urn:x-lexisnexis:content:directory:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:doc="http://www.lexisnexis.com/xmlschemas/content/shared/document-level-metadata/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:entity="http://www.lexisnexis.com/xmlschemas/content/shared/identified-entities/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:form="http://www.lexisnexis.com/xmlschemas/content/shared/form/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:funddoc="urn:x-lexisnexis:content:fundamentallegaldocument:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:globalentity="urn:x-lexisnexis:content:identified-entities:global:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:guid="urn:x-lexisnexis:content:guid:global:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:index="urn:x-lexisnexis:content:publicationindex:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:jurisinfo="http://www.lexisnexis.com/xmlschemas/content/legal/jurisdiction-info/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:legis="http://www.lexisnexis.com/xmlschemas/content/legal/legislation/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:legishist="http://www.lexisnexis.com/xmlschemas/content/legal/legislation-history/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:legisinfo="http://www.lexisnexis.com/xmlschemas/content/legal/legislation-info/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:lnci="http://www.lexisnexis.com/xmlschemas/content/shared/citations/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:lndocmeta="http://www.lexisnexis.com/xmlschemas/content/shared/lndocmeta/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:lnmeta="http://www.lexisnexis.com/xmlschemas/content/shared/lexisnexis-metadata/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:lnsys="http://www.lexisnexis.com/xmlschemas/content/shared/lnsys/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:lntbl="http://www.lexisnexis.com/xmlschemas/content/shared/lexisnexis-table-extensions/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:location="http://www.lexisnexis.com/xmlschemas/content/shared/location/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:lpa="urn:x-lexisnexis:content:parameter:lexispracticeadvisor:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:navaid="urn:x-lexisnexis:content:navigationaid:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:newsitem="http://www.lexisnexis.com/xmlschemas/content/news/newsitem/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:nitf="http://iptc.org/std/NITF/2006-10-18/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:org="urn:x-lexisnexis:content:organization:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:person="http://www.lexisnexis.com/xmlschemas/content/shared/person/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:primlaw="http://www.lexisnexis.com/xmlschemas/content/legal/primarylaw/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:primlawhist="http://www.lexisnexis.com/xmlschemas/content/legal/primarylaw-history/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:primlawinfo="http://www.lexisnexis.com/xmlschemas/content/legal/primarylaw-info/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:proc="http://www.lexisnexis.com/xmlschemas/content/shared/process-elements/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:pubfm="http://www.lexisnexis.com/xmlschemas/content/shared/publication-front-matter/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:pubinfo="http://www.lexisnexis.com/xmlschemas/content/shared/publication-info/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:pubup="http://www.lexisnexis.com/xmlschemas/content/shared/publication-update/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:ref="http://www.lexisnexis.com/xmlschemas/content/shared/reference/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:register="http://www.lexisnexis.com/xmlschemas/content/legal/register/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:registerinfo="http://www.lexisnexis.com/xmlschemas/content/legal/register-info/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:regulation="urn:x-lexisnexis:content:regulation:sharedservices:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:rfc="http://www.lexisnexis.com/xmlschemas/content/legal/reason-for-citing/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:seclaw="http://www.lexisnexis.com/xmlschemas/content/legal/secondary-law/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:statcode="http://www.lexisnexis.com/xmlschemas/content/legal/statutorycode/1/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:tei="http://www.tei-c.org/ns/1.0/"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:topic="urn:x-lexisnexis:content:topic:global:1"</lexisAdvNamespace>
        <lexisAdvNamespace>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</lexisAdvNamespace>
      </lexisAdvNamepaces>
    </xsl:variable>
    Variable references
    Documentation

    Description

    <xsl:template match="case:embeddedcase/@id">
    		<!-\-  Original Target XPath:  @xml:id   -\->
    		<xsl:attribute name="xml:id">
    			<xsl:apply-templates select="@*"/>
    		</xsl:attribute>
    	</xsl:template>
     NOTE: this condition should be in the 'blockquote' or 'case:decionsummary' template (output element would already be created) 
    	"Note: If case:embeddedcase occurs as a child element of blockquote then conversion need to omit tag (blockquote) and retain content."
    	
    	<xsl:template match="blockquote">
    		<!-\-  Original Target XPath:  xml:id   -\->
    		<xml:id>
    			<xsl:apply-templates select="@* | node()"/>
    		</xml:id>
    
    	</xsl:template>
     Already Done 
     <topicref href="../../common_caselaw/Rosetta_case.references-LxAdv_ref.relatedrefs.dita"/> 
    Namespace No namespace
    Used by
    Template
    Source
    <xsl:variable name="references">
      <ext:references>
        <ext:reference key="Articles cited:" value="consideredcases"/>
        <ext:reference key="Authorities Cited:" value="consideredcases"/>
        <ext:reference key="Authorities cited:" value="consideredcases"/>
        <ext:reference key="Authorities Considered:" value="consideredcases"/>
        <ext:reference key="Authors and Works cited:" value="consideredcases"/>
        <ext:reference key="AUTHORS AND WORKS JUDICIALLY NOTICED:" value="consideredcases"/>
        <ext:reference key="AUTHORS AND WORKS NOTICED:" value="consideredcases"/>
        <ext:reference key="Authors and Works Noticed:" value="consideredcases"/>
        <ext:reference key="Authors Cited" value="consideredcases"/>
        <ext:reference key="Authors cited" value="consideredcases"/>
        <ext:reference key="Autorité citée :" value="consideredcases"/>
        <ext:reference key="Autorités :" value="consideredcases"/>
        <ext:reference key="Autorités citées :" value="consideredcases"/>
        <ext:reference key="CASE CITED:" value="consideredcases"/>
        <ext:reference key="Cases Cited" value="consideredcases"/>
        <ext:reference key="CASES CITED:" value="consideredcases"/>
        <ext:reference key="Cases Cited:" value="consideredcases"/>
        <ext:reference key="Cases cited:" value="consideredcases"/>
        <ext:reference key="Cases Considered:" value="consideredcases"/>
        <ext:reference key="CASES JUDICIALLY CONSIDERED" value="consideredcases"/>
        <ext:reference key="Cases Judicially Considered" value="consideredcases"/>
        <ext:reference key="CASES JUDICIALLY NOTICED:" value="consideredcases"/>
        <ext:reference key="CASES NOTICED:" value="consideredcases"/>
        <ext:reference key="Cases Noticed:" value="consideredcases"/>
        <ext:reference key="Décision citée :" value="consideredcases"/>
        <ext:reference key="Décisions citées :" value="consideredcases"/>
        <ext:reference key="DOCTRINE" value="consideredcases"/>
        <ext:reference key="Doctrine" value="consideredcases"/>
        <ext:reference key="Doctrine citée" value="consideredcases"/>
        <ext:reference key="JURISPRUDENCE" value="consideredcases"/>
        <ext:reference key="Jurisprudence" value="consideredcases"/>
        <ext:reference key="Jurisprudence citée" value="consideredcases"/>
        <ext:reference key="Jurisprudence citée :" value="consideredcases"/>
        <ext:reference key="Jurisprudence consultée :" value="consideredcases"/>
        <ext:reference key="Législation citée :" value="legislation"/>
        <ext:reference key="Lois et règlements" value="legislation"/>
        <ext:reference key="Lois et règlements cités" value="legislation"/>
        <ext:reference key="MISCELLANEOUS WORKS CITED:" value="consideredcases"/>
        <ext:reference key="Statutes and Regulations Cited" value="legislation"/>
        <ext:reference key="STATUTES AND REGULATIONS CITED:" value="legislation"/>
        <ext:reference key="Statutes and Regulations cited:" value="legislation"/>
        <ext:reference key="Statutes and Regulations Judicially Considered" value="legislation"/>
        <ext:reference key="Statutes Cited:" value="legislation"/>
        <ext:reference key="Statutes cited:" value="legislation"/>
        <ext:reference key="STATUTES JUDICIALLY NOTICED:" value="legislation"/>
        <ext:reference key="STATUTES NOTICED:" value="legislation"/>
        <ext:reference key="Statutes Noticed:" value="legislation"/>
        <ext:reference key="Statutes, Regulations and Rule Cited:" value="legislation"/>
        <ext:reference key="Statutes, Regulations and Rules cited" value="legislation"/>
        <ext:reference key="STATUTES, REGULATIONS AND RULES CITED:" value="legislation"/>
        <ext:reference key="Statutes, Regulations and Rules Cited:" value="legislation"/>
        <ext:reference key="Authorities Cited" value="consideredcases"/>
        <ext:reference key="Authors Cited" value="consideredcases"/>
        <ext:reference key="Cases and texts cited" value="consideredcases"/>
        <ext:reference key="CASES CITED" value="consideredcases"/>
        <ext:reference key="Cases Cited" value="consideredcases"/>
        <ext:reference key="Cases cited" value="consideredcases"/>
        <ext:reference key="Doctrine citée" value="consideredcases"/>
        <ext:reference key="Jurisprudence" value="consideredcases"/>
        <ext:reference key="Législation citée" value="legislation"/>
        <ext:reference key="Lois et règlements cités" value="legislation"/>
        <ext:reference key="MISCELLANEOUS WORKS CITED" value="consideredcases"/>
        <ext:reference key="Statutes and Regulations Cited" value="legislation"/>
        <ext:reference key="Statutes cited" value="legislation"/>
        <ext:reference key="STATUTES, REGULATIONS AND RULES CITED" value="legislation"/>
        <ext:reference key="Statutes, Regulations and Rules Cited" value="legislation"/>
        <ext:reference key="Statutes, Regulations and Rules cited" value="legislation"/>
        <ext:reference key="Législation citée:" value="legislation"/>
        <ext:reference key="JURISPRUDENCE CITÉE :" value="consideredcases"/>
        <ext:reference key="Affaire citée:" value="consideredcases"/>
        <ext:reference key="Affaires citées:" value="consideredcases"/>
        <ext:reference key="Affaires citées:" value="consideredcases"/>
        <ext:reference key="Authorities & Texts:" value="consideredcases"/>
        <ext:reference key="Authorities" value="consideredcases"/>
        <ext:reference key="Autorités citées *" value="consideredcases"/>
        <ext:reference key="Autorités citées par l'appelante :" value="consideredcases"/>
        <ext:reference key="Autorités citées par l'intimé :" value="consideredcases"/>
        <ext:reference key="Autorités citées" value="consideredcases"/>
        <ext:reference key="Case Authorities and Texts:" value="consideredcases"/>
        <ext:reference key="Cases considered:" value="consideredcases"/>
        <ext:reference key="Cases referred to:" value="consideredcases"/>
        <ext:reference key="Dictionnaire cité :" value="consideredcases"/>
        <ext:reference key="Jurisprudence :" value="consideredcases"/>
        <ext:reference key="Jurisprudence :" value="consideredcases"/>
        <ext:reference key="JURISPRUDENCE DÉPOSÉE PAR L'INTIMÉE" value="consideredcases"/>
        <ext:reference key="Jurisprudence soumise" value="consideredcases"/>
        <ext:reference key="Jurisprudence:" value="consideredcases"/>
        <ext:reference key="Législation citée:" value="legislation"/>
        <ext:reference key="Liste de jurisprudence" value="legislation"/>
        <ext:reference key="Liste des jugements à l'appui:" value="consideredcases"/>
        <ext:reference key="LISTE DES JUGEMENTS À L'APPUI" value="consideredcases"/>
        <ext:reference key="Loi citée:" value="legislation"/>
        <ext:reference key="Lois citées:" value="legislation"/>
        <ext:reference key="Lois et règlements cités :" value="legislation"/>
        <ext:reference key="Par l'intimé :" value="consideredcases"/>
        <ext:reference key="Statutes considered:" value="legislation"/>
        <ext:reference key="Statutes Referred to:" value="legislation"/>
        <ext:reference key="Statutes referred to:" value="legislation"/>
        <ext:reference key="Tribunal decisions considered:" value="consideredcases"/>
        <ext:reference key="STATUTE AND REGULATION CITED" value="legislation"/>
        <ext:reference key="STATUTES AND REGULATION CITED" value="legislation"/>
        <ext:reference key="STATUTES AND REGULATION CITED:" value="legislation"/>
        <ext:reference key="REGULATION CITED" value="legislation"/>
        <ext:reference key="STATUTE CITED" value="legislation"/>
        <ext:reference key="Rules and Regulations considered" value="legislation"/>
        <ext:reference key="Lois, règlements et règles cités:" value="legislation"/>
        <ext:reference key="STATUTES, RULES AND REGULATIONS CITED" value="legislation"/>
        <ext:reference key="Rules cited" value="legislation"/>
        <ext:reference key="Regulations Cited" value="legislation"/>
        <ext:reference key="Lois et règlement cités" value="legislation"/>
        <ext:reference key="LOI ET RÈGLEMENT CITÉS" value="legislation"/>
        <ext:reference key="RÈGLEMENT CITÉ" value="legislation"/>
        <ext:reference key="STATUTES, RULES AND REGULATIONS CITED" value="legislation"/>
        <ext:reference key="Autorités consultées:" value="consideredcases"/>
        <ext:reference key="AUTORITÉS CONSULTÉES" value="consideredcases"/>
        <ext:reference key="Autorités citées par la requérante:" value="consideredcases"/>
        <ext:reference key="Autres autorités consultées" value="consideredcases"/>
        <ext:reference key="Case Authorities Referred to" value="consideredcases"/>
        <ext:reference key="Liste des autorités citées" value="consideredcases"/>
        <ext:reference key="JURISPRUDENCE CITÉE" value="consideredcases"/>
        <ext:reference key="Doctrine et jurisprudence :" value="consideredcases"/>
        <ext:reference key="Cases referred to" value="consideredcases"/>
        <ext:reference key="LEGISLATION:" value="legislation"/>
      </ext:references>
    </xsl:variable>
    Variable Title_Dpsi_Code_CA05
    Documentation

    Description

    Instructions [common element]

    docinfo:hier becomes doc:hier, with these children:

    • docinfo:hier/docinfo:hierlev becomes doc:hier/doc:hierlev.
    • docinfo:hier/docinfo:hierlev/heading becomes doc:hier/doc:hierlev/heading
    • docinfo:hier/docinfo:hierlev/heading/title becomes doc:hier/doc:hierlev/heading/title

    Note: The attribute @role is suppressed. The nesting level of a doc:hierlev determines its role in the hierarchy.

    Note: if nl is coming as child of docinfo:hierlev/heading/title then it should be replaced by a white space in the target - Applicable for CA06-CA07

    Note: Applicable for CA05-CA08: Attribute docinfo:hierlev/@exclude-from-displayunits="true" should be converted into attribute doc:hier/@includeintoc="false".

    Note: Applicable for CA09: title may contain num. Suppress num tag but output content. For example: <docinfo:hier><docinfo:hierlev><heading><title><num>6F1</num> Appellant Form (A1)</title></heading></docinfo:hierlev></docinfo:hier> becomes <doc:hier><doc:hierlev><heading><title>6F1 Appellant Form (A1)</title></heading></doc:hierlev></doc:hier>

    Note: Suppress inlineobject if it's found within docinfo:hierlev element. i.e, /docinfo/docinfo:hier/docinfo:hierlev/docinfo:hierlev/docinfo:hierlev/heading/inlineobject, /docinfo/docinfo:hier/docinfo:hierlev/docinfo:hierlev/docinfo:hierlev/heading/subtitle/inlineobject and /docinfo/docinfo:hier/docinfo:hierlev/docinfo:hierlev/docinfo:hierlev/heading/title/inlineobject.

    Source XML

     <docinfo:hier> <docinfo:hierlev role="ancestor">
    					<heading> <title>Victoria Acts</title> </heading>
    					<docinfo:hierlev role="ancestor"> <heading>
    					<title>E</title> </heading> <docinfo:hierlev
    					role="ancestor"> <heading> <title>EL</title>
    					</heading> <docinfo:hierlev role="ancestor"> <heading>
    					<title>ELECTRICITY SAFETY ACT 1998</title> </heading>
    					<docinfo:hierlev role="me"> <heading> <title>ELECTRICITY
    					SAFETY ACT 1998�</title> </heading> </docinfo:hierlev>
    					</docinfo:hierlev> </docinfo:hierlev> </docinfo:hierlev>
    					</docinfo:hierlev> </docinfo:hier> 

    Target XML

     <doc:hier> <doc:hierlev> <heading>
    					<title>Victoria Acts</title> </heading> <doc:hierlev>
    					<heading> <title>E</title> </heading>
    					<doc:hierlev> <heading> <title>EL</title>
    					</heading> <doc:hierlev> <heading> <title>ELECTRICITY
    					SAFETY ACT 1998</title> </heading> <doc:hierlev>
    					<heading> <title>ELECTRICITY SAFETY ACT 1998�</title>
    					</heading> </doc:hierlev> </doc:hierlev> </doc:hierlev>
    					</doc:hierlev> </doc:hierlev> </doc:hier> 

    Source XML nl as child of docinfo:hierlev/heading/title

     <docinfo:hier> <docinfo:hierlev role="ancestor">
    					<heading> <title>Young Offenders Act (Canada)</title>
    					</heading> <docinfo:hierlev role="ancestor"> <heading>
    					<title>RULES OF YOUTH COURT REGULATION</title> </heading>
    					<docinfo:hierlev role="ancestor"> <heading>
    					<title>SCHEDULE</title> </heading> <docinfo:hierlev
    					role="me"> <heading> <title>ROVINCIAL COURT OF
    					ALBERTA<nl/>FORM 100<nl/>IN THE YOUTH DIVISION OF THE PROVINCIAL
    					COURT OF ALBERTA<nl/>NOTICE OF APPLICATION </title> </heading>
    					</docinfo:hierlev> </docinfo:hierlev> </docinfo:hierlev>
    					</docinfo:hierlev> </docinfo:hier> 

    Target XML nl as child of docinfo:hierlev/heading/title

     <doc:hier> <doc:hierlev> <heading> <title>Young
    					Offenders Act (Canada)</title> </heading> <doc:hierlev>
    					<heading> <title>RULES OF YOUTH COURT REGULATION</title>
    					</heading> <doc:hierlev> <heading>
    					<title>SCHEDULE</title> </heading> <doc:hierlev>
    					<heading> <title>ROVINCIAL COURT OF ALBERTA FORM 100 IN THE YOUTH
    					DIVISION OF THE PROVINCIAL COURT OF ALBERTA NOTICE OF APPLICATION </title>
    					</heading> </doc:hierlev> </doc:hierlev> </doc:hierlev>
    					</doc:hierlev> </doc:hierlev> 

    Description

     rosetta element: docinfo:hier 
     <topicref href="../../common_newest/Rosetta_docinfo.hier-LxAdv-doc.hier.dita"/> 
        Original DITA file location:  DITA\ConversionInstructions\Rosetta\common_newest\Rosetta_docinfo.hier-LxAdv-doc.hier.dita  
    Namespace No namespace
    Used by
    Source
    <xsl:variable name="Title_Dpsi_Code_CA05">
      <codes>
        <code key="0U95" value="Statutes"/>
        <code key="0U9A" value="Former Statutes"/>
        <code key="0U9S" value="Statutes"/>
        <code key="0U9V" value="Statutes"/>
        <code key="0U9X" value="Former Statutes"/>
        <code key="0UA4" value="Statutes"/>
        <code key="0UA6" value="Former Statutes"/>
        <code key="0UAN" value="Statutes"/>
        <code key="0UAP" value="Former Statutes"/>
        <code key="0UCM" value="Statutes"/>
        <code key="0UCO" value="Former Statutes"/>
        <code key="0UCV" value="Statutes"/>
        <code key="0UCX" value="Former Statutes"/>
        <code key="0UD9" value="Statutes"/>
        <code key="0UDB" value="Former Statutes"/>
        <code key="0UDF" value="Employment Insurance Statutes"/>
        <code key="0UDL" value="Statutes"/>
        <code key="0UDM" value="Statutes"/>
        <code key="0UDT" value="Employment Standards Statutes"/>
        <code key="0UDV" value="Employment Standards Former Statutes"/>
        <code key="0UEE" value="Statutes"/>
        <code key="0UEF" value="Former Statutes"/>
        <code key="0UFB" value="Human Rights/Equity Issues"/> Statutes"/>
    			<code key="0UFD" value="Human Rights/Equity Issues"/> Former Statutes"/>
    			<code key="0UFT" value="Statutes"/>
        <code key="0UHJ" value="Statutes"/>
        <code key="0UHL" value="Former Statutes"/>
        <code key="0UI1" value="Labour Relations Statutes"/>
        <code key="0UI3" value="Labour Relations Former Statutes"/>
        <code key="0UJ2" value="Statutes"/>
        <code key="0UJ3" value="Former Statutes"/>
        <code key="0UJ8" value="Statutes"/>
        <code key="0UJ9" value="Former Statutes"/>
        <code key="0UN0" value="Lois"/>
        <code key="0UN5" value="Lois"/>
        <code key="0UNO" value="Lois"/>
        <code key="0UNZ" value="Lois"/>
        <code key="0UOD" value="Lois"/>
        <code key="0UOJ" value="Lois"/>
        <code key="0UOS" value="Lois"/>
        <code key="0UPV" value="Statutes"/>
        <code key="0UPX" value="Former Statutes"/>
        <code key="0US1" value="Former Statutes"/>
        <code key="0US6" value="Lois"/>
        <code key="0USC" value="Archives - Lois"/>
        <code key="0UTB" value="Lois"/>
        <code key="0UVY" value="Acts"/>
        <code key="0USN" value="Former Acts"/>
      </codes>
    </xsl:variable>
    Variable Title_Dpsi_Code_CA10
    Namespace No namespace
    Used by
    Source
    <xsl:variable name="Title_Dpsi_Code_CA10">
      <codes>
        <code key="0U91" value="Commentary"/>
        <code key="0U9L" value="Commentary"/>
        <code key="0U9M" value="Commentary"/>
        <code key="0UA0" value="Commentary"/>
        <code key="0UAK" value="Commentary"/>
        <code key="0UB1" value="Employment Insurance Commentary"/>
        <code key="0UCG" value="Commentary"/>
        <code key="0UCI" value="Commentary"/>
        <code key="0UCS" value="Commentary"/>
        <code key="0UDE" value="Editorial Board & Case Comments"/>
        <code key="0UDJ" value="Commentary"/>
        <code key="0UDQ" value="Topical Index to Summaries"/>
        <code key="0UEB" value="Commentary"/>
        <code key="0UFA" value="Human Rights/Equity Issues Commentary"/>
        <code key="0UFQ" value="Commentary"/>
        <code key="0UHE" value="Commentary"/>
        <code key="0UHG" value="Bulletins and Social Security Agreements"/>
        <code key="0UHU" value="Employment Standards Commentary"/>
        <code key="0UHZ" value="Labour Relations Commentary"/>
        <code key="0UJ0" value="Commentary"/>
        <code key="0UJ4" value="Commentary"/>
        <code key="0UMX" value="Commentaires, Index et Abréviations"/>
        <code key="0UN3" value="Commentaires, Index et Abréviations"/>
        <code key="0UNN" value="Commentaires, bibliographies et index"/>
        <code key="0UNY" value="Commentaires, Index et Abréviations"/>
        <code key="0UO5" value="Commentaires, Index et Tables"/>
        <code key="0UOI" value="Commentaires, Index et Abréviations"/>
        <code key="0UOM" value="Modèles de procédures"/>
        <code key="0UOR" value="Commentaires, Index, Abréviations et Adresses"/>
        <code key="0UPT" value="Commentary"/>
        <code key="0US5" value="Équipe de rédaction, tables, grilles et index"/>
        <code key="0USQ" value="Jurisprudence - Annotations de Dubois et Schneider"/>
        <code key="0UTA" value="Commentaires et Indexes"/>
        <code key="0V21" value="MFDA Staff Notices"/>
        <code key="0V2H" value="Montreal Stock Exchange Charter & List of Fees"/>
        <code key="0V5X" value="Quantum of Damages Table"/>
        <code key="0V5Y" value="Code Citator"/>
        <code key="0VNX" value="Securities Commissions"/>
      </codes>
    </xsl:variable>
    Variable Title_Dpsi_Code
    Namespace No namespace
    Used by
    Source
    <xsl:variable name="Title_Dpsi_Code">
      <codes>
        <code key="0U96" value="Regulations"/>
        <code key="0U9B" value="Former Regulations"/>
        <code key="0U9T" value="Regulations"/>
        <code key="0U9W" value="Regulations"/>
        <code key="0U9Y" value="Former Regulations"/>
        <code key="0UA5" value="Regulations"/>
        <code key="0UA7" value="Former Regulations"/>
        <code key="0UAO" value="Regulations"/>
        <code key="0UAQ" value="Former Regulations"/>
        <code key="0UCN" value="Regulations"/>
        <code key="0UCP" value="Former Regulations"/>
        <code key="0UCW" value="Regulations"/>
        <code key="0UCY" value="Former Regulations"/>
        <code key="0UDA" value="Regulations"/>
        <code key="0UDC" value="Former Regulations"/>
        <code key="0UDG" value="Employment Insurance Regulations"/>
        <code key="0UDN" value="Regulations"/>
        <code key="0UDO" value="Regulations"/>
        <code key="0UDU" value="Employment Standards Regulations"/>
        <code key="0UEG" value="Regulations"/>
        <code key="0UEJ" value="Employment Standards Former Regulations"/>
        <code key="0UFC" value="Human Rights/Equity Issues Regulations"/>
        <code key="0UFE" value="Human Rights/Equity Issues Former Regulations"/>
        <code key="0UFU" value="Regulations"/>
        <code key="0UHK" value="Regulations"/>
        <code key="0UHM" value="Former Regulations"/>
        <code key="0UI2" value="Labour Relations Regulations"/>
        <code key="0UI4" value="Labour Relations Former Regulations"/>
        <code key="0UJA" value="Regulations"/>
        <code key="0UJB" value="Former Regulations"/>
        <code key="0UN6" value="Règlements"/>
        <code key="0UNP" value="Règlements"/>
        <code key="0UOE" value="Règlements"/>
        <code key="0UOK" value="Règlements"/>
        <code key="0UOT" value="Règlements"/>
        <code key="0UOV" value="Archives - Règlements"/>
        <code key="0UPW" value="Regulations"/>
        <code key="0UPY" value="Former Regulations"/>
        <code key="0US7" value="Règlements"/>
        <code key="0USD" value="Archives - Règlements"/>
        <code key="0USP" value="Former Regulations"/>
        <code key="0UTC" value="Règlements"/>
        <code key="0UVZ" value="Regulations"/>
        <code key="0VNX" value="Securities Commissions"/>
        <code key="0U98" value="CSA Regulatory Documents"/>
        <code key="0USA" value="Règles de pratique"/>
        <code key="0UW1" value="Codes of Practice"/>
        <code key="0V1Y" value="Universal Market Integrity Rules and Policies"/>
        <code key="0V22" value="MFDA By-laws, Rules and Policies"/>
        <code key="0V24" value="ICE Futures Canada Inc. Rules"/>
        <code key="0V26" value="NASDAQ Marketplace Rules"/>
        <code key="0V28" value="CNSX Rules, Policies and Notices"/>
        <code key="0V2A" value="TSX Rule Book and Policies"/>
        <code key="0V2B" value="TSX Venture Exchange Rules and Policies"/>
        <code key="0V2F" value="NEX Policies"/>
        <code key="0V2I" value="Montreal Stock Exchange Rules, Policies, Guidelines and Fees"/>
        <code key="0U9C" value="Forms"/>
        <code key="0U9R" value="Forms"/>
        <code key="0UAR" value="Forms"/>
        <code key="0UCU" value="Forms"/>
        <code key="0UCZ" value="Forms & Precedents"/>
        <code key="0UDS" value="Employment Standards Forms"/>
        <code key="0UDW" value="Government and Agency Documents"/>
        <code key="0UEH" value="Forms"/>
        <code key="0UHF" value="Government and Agency Documents"/>
        <code key="0UI0" value="Labour Relations Forms"/>
        <code key="0UJC" value="Forms"/>
        <code key="0UOA" value="Formulaires"/>
        <code key="0UQ0" value="Forms"/>
        <code key="0USW" value="Formulaires"/>
        <code key="0V20" value="IIROC & Market Integrity Notices, Guides, and Updates"/>
        <code key="0V23" value="MFDA Forms"/>
        <code key="0V25" value="ICE Futures Canada Inc. Annexes"/>
        <code key="0V29" value="CNSX Forms"/>
        <code key="0V2D" value="TSX Venture Exchange Corporate Finance Manual Appendices and Forms"/>
        <code key="0V2G" value="NEX Forms and Appendices"/>
        <code key="0V2J" value="Montreal Stock Exchange Forms"/>
        <!-- CA01 Start		-->
        <code key="0UW2" value="Cases"/>
        <code key="0UXQ" value="Cases"/>
        <code key="0UXS" value="Cases"/>
        <code key="0UXT" value="Summaries (Appeals & Cases)"/>
        <code key="0UXU" value="Cases"/>
        <code key="0UXV" value="Cases"/>
        <code key="0UXW" value="Cases"/>
        <code key="0UXX" value="Cases"/>
        <code key="0UXZ" value="Cases"/>
        <code key="0UY0" value="Cases"/>
        <code key="0UY1" value="Cases"/>
        <code key="0UY3" value="Cases"/>
        <code key="0UY4" value="Jurisprudence - Texte intégraux et résumés archivés"/>
        <code key="0UY6" value="Jurisprudence"/>
        <code key="0UY7" value="Résumés de jurisprudence"/>
        <code key="0UY8" value="Jurisprudence sélectionnée"/>
        <code key="0UY9" value="Jurisprudence - Textes intégraux"/>
        <code key="0UYC" value="Cases"/>
        <code key="0V45" value="Cases"/>
        <code key="0V47" value="Cases"/>
        <code key="0V48" value="Cases"/>
        <code key="0V49" value="Cases"/>
        <!-- CA01 End		-->
      </codes>
    </xsl:variable>
    Variable docinfoidtext
    Documentation

    Description

    h becomes h. The attributes of h are handled as follows:

    • h/@l becomes h/@level.
    • h/@align becomes h/@align. The valid values for h/@align are:
      • "left"
      • "right"
      • "center"

    If the Stream is UK08CA and the parent element is entry, pass through the element and process the children.

    Source XML

     <h l="3" align="center"> <emph typestyle="it">Background</emph> </h> 

    Target XML

     <h level="3" align="center"> <emph typestyle="it">Background</emph> </h>
    				

    Within UK08CA stream, when source is having emph followed by inlineobject inside base:h element h/emph/inlineobjectthan in Target it should Map with and becomes emph/ref:inlineobject.

    form/bodytext/h becomes form:h.

     <h> <emph typestyle="bf">Table 2 Estimation of regression coefficients using the SUR
    					model <inlineobject type="image" mimetype="image/gif" filename="JFRC_2005_Vol13_Issue2_May_167_1.gif" />
    					</emph> </h> Becomes <emph typestyle="bf">Table 2 Estimation of regression
    					coefficients using the SUR model <ref:inlineobject> <ref:locator> <ref:locator-key>
    					<ref:key-name name="object-key"/> <ref:key-value value="X-Y-JFRC_2005_Vol13_Issue2_May_167_1"/>
    					<!-- X and Y are LNI and SMI values obtained from CSSM --> </ref:locator-key>
    					<ref:locator-params> <proc:param name="componentseq" value="1"/> <proc:param name="object-type"
    					value="image"/> <!-- allowable values: “image”; (from .jpg, .gif, .png, .bmp)--> <proc:param
    					name="object-smi" value=""/> <!-- This @value assignment is done by conversion program -->
    					</ref:locator-params> </ref:locator> </ref:inlineobject> </emph> 

    Description

     end topichead  glp:note  
     start topichead  h  
     <topicref href="../../common_newest/Rosetta_h-LxAdv-h.dita"/> 
    Namespace No namespace
    Select /*/docinfo/docinfo:doc-id/text()
    Used by
    Template
    Source
    <xsl:variable name="docinfoidtext" select="/*/docinfo/docinfo:doc-id/text()"/>
    Function lnf:trim (arg)
    Documentation

    Description

    lnf:trim Function

    Adapted from "functx:trim" (http://www.xsltfunctions.com/xsl/functx_trim.html)

    This function removes whitespace at the beginning and end of a string. Unlike the built-in normalize-space function, it only removes leading and trailing whitespace, not whitespace in the middle of the value. Whitespace is defined as it is in XML, namely as space, tab, carriage return and line feed characters. If $arg is the empty sequence, it returns a zero-length string.


    Description

      default fixSourceNesting mode END  
      modal template rules END  
      functions START  
      lnf:trim Function START  
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type xs:string
    Parameters
    QName Namespace Type
    arg No namespace xs:string?
    Import precedence 0
    Source
    <xsl:function name="lnf:trim" as="xs:string">
      <xsl:param name="arg" as="xs:string?"/>
      <xsl:sequence select=" replace( replace( $arg , '\s+$' , '' ) , '^\s+' , '' ) "/>
    </xsl:function>
    Function lnf:replaceString (fileCodeInput, states)
    Documentation

    Description

    lnf:replaceString Function

    This function was created to remove specific string segments from the VISF output as part of the MNCR to VISF code base.

    It will remove all occurrences of all string segments contained within $states from the input string $fileCodeInput.


    Description

      lnf:trim Function END  
      replaceString START  
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type xs:string
    Used by
    References
    Parameters
    QName Namespace Type
    fileCodeInput No namespace xs:string
    states No namespace xs:string*
    Import precedence 0
    Source
    <xsl:function name="lnf:replaceString" as="xs:string">
      <xsl:param name="fileCodeInput" as="xs:string"/>
      <xsl:param name="states" as="xs:string*"/>
      <xsl:choose>
        <xsl:when test=" (for $s in $states return contains( $fileCodeInput , $s ))[.][1] ">
          <xsl:variable name="fileCodeInputNew" as="xs:string*">
            <xsl:for-each select="$states[ contains( $fileCodeInput , . ) ][1]">
              <xsl:sequence select="substring-before( $fileCodeInput , . )"/>
              <xsl:sequence select="substring-after( $fileCodeInput , . )"/>
            </xsl:for-each>
          </xsl:variable>
          <xsl:sequence select="lnf:replaceString( string-join( $fileCodeInputNew , '' ) , $states )"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:sequence select="$fileCodeInput"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:function>
    Function lnf:titleCase (s)
    Documentation

    Description

    Function to return a string in Title Case. Currently configured to exclude 'and', 'or'.

    Call using <xsl:sequence select="string-join(for $x in tokenize($text,'\s') return lnf:titleCase($x),' ')"/>


    Description

      replaceString END  
     titleCase START 
     function copied from http://p2p.wrox.com/xslt/80938-title-case-string.html 
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Parameters
    QName Namespace Type
    s No namespace xs:string
    Import precedence 0
    Source
    <xsl:function name="lnf:titleCase">
      <xsl:param name="s" as="xs:string"/>
      <xsl:choose>
        <!-- when lower case string is 'and', 'or' just output  -->
        <xsl:when test="lower-case($s)=('and','or')">
          <xsl:value-of select="lower-case($s)"/>
        </xsl:when>
        <!-- when the string is in upper case the below would originally pass through in all upper case; commenting -->
        <!--<xsl:when test="$s=upper-case($s)">
    				<!-\-<xsl:value-of select="$s"/>-\->
    			</xsl:when>-->
        <!-- otherwise convert the first char to upper case and subsequent chars to lower case  -->
        <xsl:otherwise>
          <xsl:value-of select="concat(upper-case(substring($s, 1, 1)), lower-case(substring($s, 2)))"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:function>
    Function lnf:stringToTitleCase (inputString, keepAllLower)
    Documentation

    Description

     titleCase END 
     stringToTitleCase START 
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type xs:string
    References
    Parameters
    QName Namespace Type
    inputString No namespace xs:string
    keepAllLower No namespace xs:string*
    Import precedence 0
    Source
    <xsl:function name="lnf:stringToTitleCase" as="xs:string">
      <xsl:param name="inputString" as="xs:string"/>
      <!--  input string of one or more words  -->
      <xsl:param name="keepAllLower" as="xs:string*"/>
      <!--  string sequence of words to keep as lowercase, such as the, or, and, for, of  -->
      <xsl:variable name="outputSequence" as="xs:string*">
        <xsl:for-each select="tokenize( $inputString , '\s' )">
          <xsl:choose>
            <!-- when lower case string is any one of $keepAllLower, just output lower-case of it  -->
            <xsl:when test="lower-case( . ) = $keepAllLower">
              <xsl:value-of select="lower-case( . )"/>
            </xsl:when>
            <xsl:when test="contains( . , '-' )">
              <xsl:value-of select="lnf:genStringToTitleCase( . , $keepAllLower , '-' )"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="concat( upper-case( substring( . , 1 , 1 ) ) , lower-case( substring( . , 2 ) ) )"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each>
      </xsl:variable>
      <xsl:sequence select="string-join( $outputSequence , ' ' )"/>
      <!--  string join the sequence with a space as the separator  -->
    </xsl:function>
    Function lnf:genStringToTitleCase (inputString, keepAllLower, stringSeparator)
    Documentation

    Description

     stringToTitleCase END 
     genStringToTitleCase START 
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type xs:string
    Used by
    Parameters
    QName Namespace Type
    inputString No namespace xs:string
    keepAllLower No namespace xs:string*
    stringSeparator No namespace xs:string
    Import precedence 0
    Source
    <xsl:function name="lnf:genStringToTitleCase" as="xs:string">
      <xsl:param name="inputString" as="xs:string"/>
      <!--  input string of one or more words  -->
      <xsl:param name="keepAllLower" as="xs:string*"/>
      <!--  string sequence of words to keep as lowercase, such as the, or, and, for, of  -->
      <xsl:param name="stringSeparator" as="xs:string"/>
      <!--  character to break up/tokenize string, normally a space  -->
      <xsl:variable name="outputSequence" as="xs:string*">
        <xsl:for-each select="tokenize( $inputString , $stringSeparator )">
          <xsl:choose>
            <!-- when lower case string is any one of $keepAllLower, just output lower-case of it  -->
            <xsl:when test="lower-case( . ) = $keepAllLower">
              <xsl:value-of select="lower-case( . )"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="concat( upper-case( substring( . , 1 , 1 ) ) , lower-case( substring( . , 2 ) ) )"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each>
      </xsl:variable>
      <xsl:sequence select="string-join( $outputSequence , $stringSeparator )"/>
      <!--  string join the sequence with the separator  -->
    </xsl:function>
    Function lnf:removeSequenceOfStrings (inputString, stringsToRemove, caseInsensitive)
    Documentation

    Description

    lnf:removeSequenceOfStrings Function

    This function was created to remove a set of substrings from an input string, if any of these strings exist in the input string

    $stringsToRemove is the input string sequence of *regex* items; the function will go through this sequence one by one and remove all occurrences of each item in this sequence.

    The removal can be case sensitive or case insensitive.


    Description

     genStringToTitleCase END 
      removeSequenceOfStrings START  
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type xs:string
    Used by
    References
    Parameters
    QName Namespace Type
    caseInsensitive No namespace xs:boolean
    inputString No namespace xs:string
    stringsToRemove No namespace xs:string*
    Import precedence 0
    Source
    <xsl:function name="lnf:removeSequenceOfStrings" as="xs:string">
      <xsl:param name="inputString" as="xs:string"/>
      <xsl:param name="stringsToRemove" as="xs:string*"/>
      <xsl:param name="caseInsensitive" as="xs:boolean"/>
      <xsl:choose>
        <xsl:when test=" string-join( $stringsToRemove , '' ) = '' ">
          <xsl:sequence select="$inputString"/>
        </xsl:when>
        <xsl:when test=" $stringsToRemove[1] = '' or $stringsToRemove[1] = () ">
          <xsl:sequence select="lnf:removeSequenceOfStrings( $inputString , remove($stringsToRemove, 1) , $caseInsensitive )"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:sequence select="lnf:removeSequenceOfStrings( replace( $inputString , $stringsToRemove[1] , '' , if ($caseInsensitive) then 'i' else '' ) , remove($stringsToRemove, 1) , $caseInsensitive )"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:function>
    Function lnf:substringBeforeLast (inputString, searchString)
    Documentation

    Description

    lnf:substringBeforeLast Function

    This function will return that part of an input string that appears before the final occurence of an input substring.


    Description

      removeSequenceOfStrings END  
      @SBy:  2016-09-20  ROM 1218 IRM Strategic:  add substringBeforeLast function  
       Original idea from Tomalak at stackoverflow, http://stackoverflow.com/questions/1119449/removing-the-last-characters-in-an-xslt-string/1119666#1119666  
      substringBeforeLast START  
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type xs:string
    Used by
    References
    Parameters
    QName Namespace Type
    inputString No namespace xs:string
    searchString No namespace xs:string
    Import precedence 0
    Source
    <xsl:function name="lnf:substringBeforeLast" as="xs:string">
      <xsl:param name="inputString" as="xs:string"/>
      <xsl:param name="searchString" as="xs:string"/>
      <xsl:variable name="remString" as="xs:string" select="substring-after( $inputString , $searchString )"/>
      <xsl:sequence select="concat(              substring-before( $inputString , $searchString ) ,              if (contains( $remString , $searchString )) then               concat( $searchString ,                lnf:substringBeforeLast( $remString , $searchString )              )              else '' )"/>
    </xsl:function>
    Function lnf:createDocIdString (inputElement)
    Documentation

    Description

    lnf:createDocIdString Function

    This function will create the correct string for DOC-ID style links for certain conversions. For the Internal Revenue Manual as an example, where $legacy-filename = 'IRSMNL', and input string is 'IRM 3.10.72', the output string will be 'IRSMNL-3_10_72'.


    Description

      substringBeforeLast END  
      @SBy:  2016-11-04  ROM 1218 IRM Strategic:  save the DOC-ID string logic for use in ref:cross-reference  
      createDocIdString START  
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type xs:string
    References
    Variable
    Parameter
    Parameters
    QName Namespace Type
    inputElement No namespace element()
    Import precedence 0
    Source
    <xsl:function name="lnf:createDocIdString" as="xs:string">
      <xsl:param name="inputElement" as="element()"/>
      <xsl:variable name="inputString" as="xs:string" select="if ($inputElement/source_lnci:cite/@normcite != '') then                         $inputElement/source_lnci:cite/@normcite                        else                        if (starts-with( string( $inputElement ) , 'IRM ' )) then                         substring-after( string( $inputElement ) , 'IRM ' )                        else                         string( $inputElement )"/>
      <xsl:variable name="badCharacters" as="xs:string" select="translate( $inputString , $acceptableID_Chars , '' )"/>
      <xsl:variable name="normString" select="translate( $inputString , $badCharacters , ' ' )"/>
      <xsl:variable name="outputString" select="translate( normalize-space( $normString ) , ' .' , '__' )"/>
      <xsl:sequence select="concat( $legacy-filename , '-' , $outputString )"/>
    </xsl:function>
    Function lnf:createValidIDstring (inputString)
    Documentation

    Description

    lnf:createValidIDstring Function

    Given an arbitrary input string, this function will return a string that is valid for attribute values of type ID.


    Description

      createDocIdString END  
      @SBy:  2017-05-25  ROCKET ReWrites:  function to return a string that is a valid value for attributes of type ID  
      createValidIDstring START  
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type xs:string
    References
    Parameters
    QName Namespace Type
    inputString No namespace xs:string
    Import precedence 0
    Source
    <xsl:function name="lnf:createValidIDstring" as="xs:string">
      <xsl:param name="inputString" as="xs:string"/>
      <xsl:variable name="badCharacters" as="xs:string" select="translate( $inputString , $acceptableID_Chars , '' )"/>
      <xsl:variable name="normString" select="translate( $inputString , $badCharacters , '' )"/>
      <xsl:sequence select="if (translate( substring( $normString , 1 , 1 ) , $unallowedFirstCharAcceptableID_Chars , '' ) = '') then concat( '_' , $normString ) else $normString"/>
    </xsl:function>
    Function lnf:siblingBlockGrouping (groupingContainer, blockElements, siblingNodes)
    Documentation

    Description

    lnf:siblingBlockGrouping Function

    This function will sibling recursion type grouping for situations such as handling children of "p" in the source converting to p/text - p/blockquote - p/text etc. in the target; for that scenario, the $groupingContainer = 'text' (the text element), $blockElements = ('blockquote', 'table', etc), and $siblingNodes would contain the set of siblings that need to be split into groups of $groupingContainer elements broken up by $blockElements.


    Description

      createValidIDstring END  
      NOTE:  the next two functions can allow a transformation to not require sibling recursion moded rules such as mode="textEleRecurse".   However, this function does not apply templates and so does not
    				work in the "target" space.  One must use this function and throw results to a variable, then apply templates on that variable to transform the nodes to target format.  Keep in mind that any processing
    				of such a variable only has the variable plus descendants in scope.  So, for example, footnote processing that looks for matching node values in the entire source document tree will not actually
    				be searching the entire tree anymore, just the tree defined by the variable.  In general, it is safest to use these functions when writing the entire document to a variable and then A-T on that variable.  
      @SBy:  2017-01-17  ROM 1218 IRM Strategic:	general function version of sibling recursion type grouping, for situations such as 
    																					handling children of "p" in the source converting to p/text - p/blockquote - p/text etc. in the target  
      siblingBlockGrouping START  
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type item()*
    Used by
    References
    Parameters
    QName Namespace Type
    blockElements No namespace xs:string*
    groupingContainer No namespace xs:string
    siblingNodes No namespace element()
    Import precedence 0
    Source
    <xsl:function name="lnf:siblingBlockGrouping" as="item()*">
      <xsl:param name="groupingContainer" as="xs:string"/>
      <!--  name of container element to group consecutive siblings under (typically the "text" element)   -->
      <xsl:param name="blockElements" as="xs:string*"/>
      <!--  list of element names (can be empty string) that cannot be grouped under $groupingContainer (typically table, blockquote, etc)   -->
      <xsl:param name="siblingNodes" as="element()"/>
      <!--  (remaining) sibling nodes (typically text() nodes and elements, can be instances of $groupingContainer too) to perform grouping on, all under a single element parent  -->
      <!--  save name of element parent  -->
      <xsl:variable name="siblingNodesParent" as="xs:string" select="name($siblingNodes)"/>
      <xsl:for-each select="$siblingNodes/node()[1]">
        <xsl:choose>
          <!--  if the first node is not an element, OR it is an element but there are no blockElements and it's not groupingContainer, or it's an element not in blockElements and it's not groupingContainer; then create container and move on   -->
          <xsl:when test=" not(self::*) or ( $blockElements = '' and not( name() = $groupingContainer ) ) or not( name() = $blockElements or name() = $groupingContainer ) ">
            <xsl:element name="{$groupingContainer}" namespace="">
              <!--  create container   -->
              <xsl:choose>
                <xsl:when test=" $blockElements = '' or not( following-sibling::node()[name() = $blockElements or name() = $groupingContainer] ) ">
                  <!--  no grouping required; just copy self and all following siblings to output, and no recurse   -->
                  <xsl:copy-of select="."/>
                  <xsl:copy-of select="following-sibling::node()"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:for-each select="following-sibling::node()[name() = $blockElements or name() = $groupingContainer][1]">
                    <!--  grouping required; change context to the first blocker (either a group container or block element) and then copy over alll preceding siblings; close container   -->
                    <xsl:copy-of select="preceding-sibling::node()"/>
                  </xsl:for-each>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:element>
            <!--  if grouping was required in prior section; change context to the first blocker again to copy over the blocker, and if necessary initiate recursive call   -->
            <xsl:if test=" not( $blockElements = '' or not( following-sibling::node()[name() = $blockElements or name() = $groupingContainer] ) ) ">
              <xsl:for-each select="following-sibling::node()[name() = $blockElements or name() = $groupingContainer][1]">
                <!--  copy over the blocker or container   -->
                <xsl:copy-of select="."/>
                <!--  if there are following siblings, need to recurse   -->
                <xsl:if test="following-sibling::node()">
                  <!--  update sibling list to be only the remaining following siblings   -->
                  <xsl:variable name="siblingNodesUpdated" as="element()">
                    <xsl:element name="{$siblingNodesParent}">
                      <xsl:copy-of select="following-sibling::node()"/>
                    </xsl:element>
                  </xsl:variable>
                  <!--  recurse   -->
                  <xsl:sequence select=" lnf:siblingBlockGrouping( $groupingContainer , $blockElements , $siblingNodesUpdated ) "/>
                </xsl:if>
              </xsl:for-each>
            </xsl:if>
          </xsl:when>
          <!--  first node is an element, AND it is an element that is either in blockElements or in groupingContainer. This is the only other possibility, so using xsl:otherwise.  Copy myself over, and recurse    -->
          <!--xsl:when test=" name() eq $blockElements or name() eq $groupingContainer "-->
          <xsl:otherwise>
            <!--  since we are a blocker or container, copy over myself   -->
            <xsl:copy-of select="."/>
            <!--  if there are following siblings, need to recurse   -->
            <xsl:if test="following-sibling::node()">
              <!--  update sibling list to be only the remaining following siblings   -->
              <xsl:variable name="siblingNodesUpdated" as="element()">
                <!-- JD: 2017-04-04: added namespace="" and copy-namespaces="no" after 
    							getting error "XTDE0440: Cannot output a namespace node for the default namespace when the element is in no namespace" (source lnvxe:footnote with p child)-->
                <xsl:element name="{$siblingNodesParent}" namespace="">
                  <xsl:copy-of select="following-sibling::node()" copy-namespaces="no"/>
                </xsl:element>
              </xsl:variable>
              <!--  recurse   -->
              <xsl:sequence select=" lnf:siblingBlockGrouping( $groupingContainer , $blockElements , $siblingNodesUpdated ) "/>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </xsl:function>
    Function lnf:siblingToParentGrouping (childElements, currentParent)
    Documentation

    Description

    lnf:siblingToParentGrouping Function

    This function will pull child elements up to be intermingled with the parent, such as handling children lnvxe:note elements of "p" in the source converting to p then lnvxe:note then p then lnvxe:note etc.in the target; for that scenario, the $childElements = 'lnvxe:note' (the note element), $currentParent would contain the parent that had one or more $childElements elements needing to be pulled up to the parent level.


    Description

      siblingBlockGrouping END  
      @SBy:  2017-01-17  ROM 1218 IRM Strategic:	general function to pull child elements up to be intermingled with the parent.  For example,  
    																					handling children note elements of "p" in the source converting to p then note then p then note etc.in the target  
      siblingToParentGrouping START  
    Namespace urn:x-lexisnexis:conversion:global:functions:1
    Type item()*
    Used by
    References
    Parameters
    QName Namespace Type
    childElements No namespace xs:string*
    currentParent No namespace element()
    Import precedence 0
    Source
    <xsl:function name="lnf:siblingToParentGrouping" as="item()*">
      <xsl:param name="childElements" as="xs:string*"/>
      <!--  list of element names (such as lnvxe:note) that need to be pulled up and mingled with the parent   -->
      <xsl:param name="currentParent" as="element()"/>
      <!--  the current single parent that contains one or more nodes including $childElements  -->
      <!--  save name of element parent  -->
      <xsl:variable name="currentParentName" as="xs:string" select="name($currentParent)"/>
      <xsl:for-each select="$currentParent/node()[1]">
        <xsl:choose>
          <!--  if the first node is not an element, OR it is an element but there are no childElements, or it's an element not in childElements; then create currentParent and move on   -->
          <xsl:when test=" not(self::*) or ( $childElements = '' ) or not( name() = $childElements ) ">
            <xsl:choose>
              <xsl:when test=" contains( $currentParentName , ':' ) ">
                <xsl:element name="{$currentParentName}">
                  <!--  create container   -->
                  <xsl:choose>
                    <xsl:when test=" $childElements = '' or not( following-sibling::node()[name() = $childElements] ) ">
                      <!--  no grouping required; just copy self and all following siblings to output, and no recurse   -->
                      <xsl:copy-of select="." copy-namespaces="no"/>
                      <xsl:copy-of select="following-sibling::node()" copy-namespaces="no"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:for-each select="following-sibling::node()[name() = $childElements][1]">
                        <!--  grouping required; change context to the first childElements element and then copy over alll preceding siblings; close currentParent   -->
                        <xsl:copy-of select="preceding-sibling::node()" copy-namespaces="no"/>
                      </xsl:for-each>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:element>
              </xsl:when>
              <xsl:otherwise>
                <xsl:element name="{$currentParentName}" namespace="">
                  <!--  create container   -->
                  <xsl:choose>
                    <xsl:when test=" $childElements = '' or not( following-sibling::node()[name() = $childElements] ) ">
                      <!--  no grouping required; just copy self and all following siblings to output, and no recurse   -->
                      <xsl:copy-of select="." copy-namespaces="no"/>
                      <xsl:copy-of select="following-sibling::node()" copy-namespaces="no"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:for-each select="following-sibling::node()[name() = $childElements][1]">
                        <!--  grouping required; change context to the first childElements element and then copy over alll preceding siblings; close currentParent   -->
                        <xsl:copy-of select="preceding-sibling::node()" copy-namespaces="no"/>
                      </xsl:for-each>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:element>
              </xsl:otherwise>
            </xsl:choose>
            <!--  if grouping was required in prior section; change context to the first childElements element again to copy over the childElements element, and if necessary initiate recursive call   -->
            <xsl:if test=" not( $childElements = '' or not( following-sibling::node()[name() = $childElements] ) ) ">
              <xsl:for-each select="following-sibling::node()[name() = $childElements][1]">
                <!--  copy over the childElements element   -->
                <xsl:copy-of select="." copy-namespaces="no"/>
                <!--  if there are following siblings, need to recurse   -->
                <xsl:if test="following-sibling::node()">
                  <!--  update sibling list to be only the remaining following siblings   -->
                  <xsl:variable name="currentParentUpdated" as="element()">
                    <xsl:element name="{$currentParentName}">
                      <xsl:copy-of select="following-sibling::node()" copy-namespaces="no"/>
                    </xsl:element>
                  </xsl:variable>
                  <!--  recurse   -->
                  <xsl:sequence select=" lnf:siblingToParentGrouping( $childElements , $currentParentUpdated ) "/>
                </xsl:if>
              </xsl:for-each>
            </xsl:if>
          </xsl:when>
          <!--  first node is an element, AND it is an element that is in childElements. This is the only other possibility, so using xsl:otherwise.  Copy myself over, and recurse    -->
          <!--xsl:when test=" name() eq $blockElements or name() eq $groupngContainer "-->
          <xsl:otherwise>
            <!--  since we are a childElements element, copy over myself   -->
            <xsl:copy-of select="." copy-namespaces="no"/>
            <!--  if there are following siblings, need to recurse   -->
            <xsl:if test="following-sibling::node()">
              <!--  update sibling list to be only the remaining following siblings   -->
              <xsl:variable name="currentParentUpdated" as="element()">
                <xsl:element name="{$currentParentName}">
                  <xsl:copy-of select="following-sibling::node()" copy-namespaces="no"/>
                </xsl:element>
              </xsl:variable>
              <!--  recurse   -->
              <xsl:sequence select=" lnf:siblingToParentGrouping( $childElements , $currentParentUpdated ) "/>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </xsl:function>
    Output (default)
    Namespace No namespace
    References
    Character Map
    Output properties
    method indent use-character-maps
    xml no a-circumflex
    Source
    <xsl:output use-character-maps="a-circumflex" method="xml" indent="no"/>
    Key idTypeValue
    Namespace No namespace
    Match fnr
    Use @fnrtoken
    Used by
    Source
    <xsl:key name="idTypeValue" match="fnr" use="@fnrtoken"/>
    Key fnr-footnote-tokens
    Namespace No namespace
    Match fnr
    Use @fntoken
    Used by
    Template
    Source
    <xsl:key name="fnr-footnote-tokens" match="fnr" use="@fntoken"/>
    Key dpsititle
    Namespace No namespace
    Match *:code
    Use string(@key)
    Used by